CentOS7源碼編譯FFmpeg的坑

前言

由於不能訪問第三方源,因此沒辦法yum安裝FFmpeg,只能選擇按照官方文檔源碼編譯。
CompilationGuide/Centos – FFmpeg
該文主要記錄遇到的問題,細節步驟請按官方文檔操作。

編譯FFmpeg報錯

ERROR: freetype2 not found using pkg-config
報上述錯誤,搜到了不少同樣錯誤的帖子,但都好像不是我這個問題,浪費很多時間。
進一步排查顯示:freetype-devel已經安裝了,通過locate freetype |grep pc也能夠查詢到/usr/lib64/pkgconfig/freetype2.pc
然後我將pc文件的路徑顯式加入到PKG_CONFIG_PATH中,保證能在terminal通過pkg-config freetype2 --libs查詢到freetype2,仍然沒有解決。
第二天早上猛然發現官方教程中存在一個:
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
PKG_CONFIG_PATH被重新賦值,屏蔽了我的添加,遂將其改爲:
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig:$PKG_CONFIG_PATH" ./configure \
問題解決,如果你碰到類似問題,希望上述信息能給你提供一些幫助。

編譯x265報錯

# CMakeFiles/CMakeError.log
Checking whether the ASM_NASM compiler is GNU using "--version" did not match "(GNU assembler)|(GCC)|(Free Software Foundation)":
NASM version 2.14.02 compiled on Jul 17 2019
Checking whether the ASM_NASM compiler is HP using "-V" did not match "HP C":
nasm: error: unrecognised option `-V'
type `nasm -h' for help
Checking whether the ASM_NASM compiler is Intel using "--version" did not match "(ICC)":
NASM version 2.14.02 compiled on Jul 17 2019
Checking whether the ASM_NASM compiler is SunPro using "-V" did not match "Sun C":
nasm: error: unrecognised option `-V'
type `nasm -h' for help
Checking whether the ASM_NASM compiler is XL using "-qversion" did not match "XL C":
nasm: error: unrecognised option `-q'
type `nasm -h' for help
Checking whether the ASM_NASM compiler is MSVC using "/?" did not match "Microsoft":
/?: warning: default output file same as input, using `nasm.out' for output
 [-w+other]
nasm: fatal: unable to open input file `/?'
Checking whether the ASM_NASM compiler is TI using "-h" did not match "Texas Instruments":
usage: nasm [-@ response file] [-o outfile] [-f format] [-l listfile]
            [options...] [--] filename
    or nasm -v (or --v) for version info

沒找到具體原因和解決辦法,就沒有--enable-libx265,有知道原因的可以留言告訴我,謝謝!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章