我在Centos6服务器上遇到了Ffmpeg和Libvpx的问题.
命令:
ffmpeg -y -i /var/www/f1ccd3a27d36270492ce660da358b436.mp4 -t 99 acodec copy -vcodec libvpx -f webm /var/www/f1ccd3a27d36270492ce660da358b436.webm 2<&1
输出:
FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6) configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab libavutil 50.15. 1 / 50.15. 1 libavcodec 52.72. 2 / 52.72. 2 libavformat 52.64. 2 / 52.64. 2 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1.19. 0 / 1.19. 0 libswscale 0.11. 0 / 0.11. 0 libpostproc 51. 2. 0 / 51. 2. 0 Seems stream 1 codec frame rate differs from container frame rate: 59.94 (2997/50) -> 29.97 (30000/1001) Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/vhosts/f1ccd3a27d36270492ce660da358b436.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isomavc1mp42 Duration: 00:04:16.32, start: 0.000000, bitrate: 650 kb/s Stream #0.0(und): Audio: aac, 44100 Hz, stereo, s16, 108 kb/s Stream #0.1(und): Video: h264, yuv420p, 480x360 [PAR 1:1 DAR 4:3], 539 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc Unknown encoder 'libvpx'
Ffmpeg配置:
--prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
问题:
Unknown encoder 'libvpx'
llogan.. 5
ffmpeg
需要配置以下内容:
--enable-libvpx
用于VP8和VP9视频编码
--enable-libopus
用于Opus音频编码,或
--enable-libvorbis
用于Vorbis音频编码
编码VP9使用-c:v libvpx-vp9
.
编码VP8使用-c:v libvpx
.
WebM的默认值为libvpx-vp9.
有关详细信息,请参阅FFmpeg Wiki:VP9和VP8.
您只需要上述音频编码器之一:建议Opus优于Vorbis,但两者都可以使用.
编码Opus使用-c:a libopus
.
编码器Vorbis使用-c:a libvorbis
.
WebM的默认值是libopus.
ffmpeg
ffmpeg
使用这些编码器的最简单方法是下载它.有关Linux,macOS和Windows的已编译可执行文件的链接,请参见FFmpeg下载页面.或者,您可以按照编译指南进行操作.