下载代码:git clone https://git.ffmpeg.org/ffmpeg.git
然后输入命令进行编译:找到下载的目录下,然后用命令进入这个文件夹下cd ffmpeg,然后输入./configure。
编译过出现错误如下:
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
分析:yasm是汇编编译器,ffmpeg为了提高效率使用了汇编指令,如MMX和SSE等。所以系统中未安装yasm时,就会报上面错误。
解决错误:安装yasm编译器。安装方法如下:
1)下载:yasm的下载链接
2)解压:把下载下来的压缩包进行解压
3)切换路径: cd yasm-1.3.0
4)执行配置: ./configure
5)编译:make
6)安装:make install
安装成功yasm你可以在进入到ffmpeg的文件夹下,进行./configure
make
make install
然后打出ffmpeg
[root@localhost ~]# cd ffmpeg
[root@localhost ffmpeg]# ./configure --prefix=/usr/local/ffmpeg --enable-debug=3 --disable-static --enable-shared
install prefix /usr/local/ffmpeg
source path .
C compiler gcc
C library glibc
ARCH x86 (generic)
big-endian no
runtime cpu detection yes
standalone assembly yes
x86 assembler yasm
MMX enabled yes
MMXEXT enabled yes
3DNow! enabled yes
3DNow! extended enabled yes
SSE enabled yes
SSSE3 enabled yes
AESNI enabled yes
AVX enabled yes
AVX2 enabled yes
AVX-512 enabled yes
AVX-512ICL enabled yes
XOP enabled yes
FMA3 enabled yes
FMA4 enabled yes
i686 features enabled yes
CMOV is fast yes
EBX available yes
EBP available yes
debug symbols yes
strip symbols yes
optimize for size no
optimizations yes
static no
shared yes
postprocessing support no
network support yes
threading support pthreads
safe bitstream reader yes
texi2html enabled no
perl enabled yes
pod2man enabled yes
makeinfo enabled no
makeinfo supports HTML no
xmllint enabled yes
External libraries:
iconv libxcb_shape libxcb_xfixes
libxcb libxcb_shm
External libraries providing hardware acceleration:
vaapi
Libraries:
avcodec avfilter avutil swscale
avdevice avformat swresample
Programs:
ffmpeg ffprobe
Enabled decoders:
aac cook movtext rv30
aac_fixed cpia mp1 rv40
aac_latm cri mp1float s302m
aasc cscd mp2 sami
ac3 cyuv mp2float sanm
ac3_fixed dca mp3 sbc
acelp_kelvin dds mp3adu scpr
adpcm_4xm derf_dpcm mp3adufloat sdx2_dpcm
adpcm_adx dfa mp3float sga
adpcm_afc dfpwm mp3on4 sgi
adpcm_agm dirac mp3on4float sgirle
adpcm_aica dnxhd mpc7 sheervideo
adpcm_argo dolby_e mpc8 shorten
adpcm_ct dpx mpeg1video simbiosis_imx
adpcm_dtk dsd_lsbf mpeg2video sipr
adpcm_ea dsd_lsbf_planar mpeg4 siren
adpcm_ea_maxis_xa dsd_msbf mpegvideo smackaud
adpcm_ea_r1 dsd_msbf_planar mpl2 smacker
adpcm_ea_r2 dsicinaudio msa1 smc
adpcm_ea_r3 dsicinvideo msmpeg4v1 smvjpeg
adpcm_ea_xas dss_sp msmpeg4v2 snow
adpcm_g722 dst msmpeg4v3 sol_dpcm
adpcm_g726 dvaudio msnsiren sonic
adpcm_g726le dvbsub msp2 sp5x
adpcm_ima_acorn dvdsub msrle speedhq
adpcm_ima_alp dvvideo mss1 speex
adpcm_ima_amv dxtory mss2 srt
adpcm_ima_apc dxv msvideo1 ssa
adpcm_ima_apm eac3 mszh stl
adpcm_ima_cunning eacmv mts2 subrip
adpcm_ima_dat4 eamad mv30 subviewer
adpcm_ima_dk3 eatgq mvc1 subviewer1
adpcm_ima_dk4 eatgv mvc2 sunrast
adpcm_ima_ea_eacs eatqi mvdv svq1
adpcm_ima_ea_sead eightbps mxpeg svq3
adpcm_ima_iss eightsvx_exp nellymoser tak
adpcm_ima_moflex eightsvx_fib notchlc targa
adpcm_ima_mtf escape124 nuv targa_y216
adpcm_ima_oki escape130 on2avc text
adpcm_ima_qt evrc opus theora
adpcm_ima_rad fastaudio paf_audio thp
adpcm_ima_smjpeg ffv1 paf_video tiertexseqvideo
adpcm_ima_ssi ffvhuff pam tiff
adpcm_ima_wav ffwavesynth pbm tmv
adpcm_ima_ws fic pcm_alaw truehd
adpcm_ms fits pcm_bluray truemotion1
adpcm_mtaf flac pcm_dvd truemotion2
adpcm_psx flic pcm_f16le truemotion2rt
adpcm_sbpro_2 flv pcm_f24le truespeech
adpcm_sbpro_3 fmvc pcm_f32be tscc2
adpcm_sbpro_4 fourxm pcm_f32le tta
adpcm_swf fraps pcm_f64be twinvq
adpcm_thp frwu pcm_f64le txd
adpcm_thp_le g723_1 pcm_lxf ulti
adpcm_vima g729 pcm_mulaw utvideo
adpcm_xa gdv pcm_s16be v210
adpcm_yamaha gem pcm_s16be_planar v210x
adpcm_zork gif pcm_s16le v308
agm gremlin_dpcm pcm_s16le_planar v408
aic gsm pcm_s24be v410
alac gsm_ms pcm_s24daud vb
alias_pix h261 pcm_s24le vble
als h263 pcm_s24le_planar vc1
amrnb h263i pcm_s32be vc1image
amrwb h263p pcm_s32le vcr1
amv h264 pcm_s32le_planar vmdaudio
anm hap pcm_s64be vmdvideo
ansi hca pcm_s64le vmnc
ape hcom pcm_s8 vorbis