webm转换的编解码器参数不正确

时间:2015-04-20 06:46:02

标签: php html5 video ffmpeg

我正在使用安装了ffmpeg的共享托管服务器。我被告知他们无法升级我的版本。我正在尝试将视频文件转换为html5格式。当我尝试转换为webm时,我得到以下错误。任何人都可以帮忙解决这个问题吗?

exec("/usr/bin/ffmpeg -i eliza.mp4 -acodec copy -vcodec copy 2>&1 video.webm");

    array(29) { [0]=> string(67) "FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers" 
[1]=> string(74) " built on Jan 29 2012 23:55:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)" [2]=> 
string(649) " 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-libdirac --enable-libfaac 
--enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb 
--enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc 
--enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 
--enable-x11grab" [3]=> string(35) " libavutil 50.15. 1 / 50.15. 1" [4]=> string(35) " 
libavcodec 52.72. 2 / 52.72. 2" [5]=> string(35) " libavformat 52.64. 2 / 52.64. 2" 
[6]=> string(35) " libavdevice 52. 2. 0 / 52. 2. 0" [7]=> string(35) " libavfilter 1.19. 0 / 1.19. 0" [8]=> 
string(35) " libswscale 0.11. 0 / 0.11. 0" [9]=> string(35) " libpostproc 51. 2. 0 / 51. 2. 0" [10]=> 
string(52) "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'eliza.mp4':" [11]=> string(11) " Metadata:" [12]=>
string(26) " major_brand : mp42" [13]=> string(23) " minor_version : 0" [14]=> string(35) " compatible_brands: 
mp42isomavc1" [15]=> string(48) " encoder : HandBrake 0.9.4 2009112300" [16]=> string(59) " Duration: 
00:00:05.56, start: 0.000000, bitrate: 551 kb/s" [17]=> string(94) " Stream #0.0(und): Video: h264, 
yuv420p, 560x320, 465 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc" [18]=> string(62) " Stream #0.1(eng): 
Audio: aac, 48000 Hz, mono, s16, 83 kb/s" [19]=> string(72) "[webm @ 0x7200a0]Only VP8 video and 
Vorbis audio are supported for WebM." [20]=> string(33) "Output #0, webm, to 'video.webm':" 
[21]=> string(11) " Metadata:" [22]=> string(33) " encoder : Lavf52.64.2" [23]=> string(89) " 
Stream #0.0(und): Video: libx264, yuv420p, 560x320, q=2-31, 465 kb/s, 90k tbn, 30 tbc" [24]=> 
string(61) " Stream #0.1(eng): Audio: libfaac, 48000 Hz, mono, 83 kb/s" [25]=> string(15) 
"Stream mapping:" [26]=> string(21) " Stream #0.0 -> #0.0" [27]=> string(21) " Stream #0.1 -> 
#0.1" [28]=> string(72) "Could not write header for output file #0 (incorrect codec parameters ?)" } 

1 个答案:

答案 0 :(得分:0)

根据您自己的错误日志:

[webm @ 0x7200a0] Only VP8 video and Vorbis audio are supported for WebM

您的输入文件 H.264 / AAC ,您尝试使用-acodec copy -vcodec copy复制源编解码器,而不是将其转换为 VP8 / Vorbis

您可以尝试重新编码该文件。不幸的是,FFmpeg版本确实已经过时了。最新版本是2.6.2(对比0.6.5)。