一段时间以来,我一直在用这个砸我的头。我有 2 个使用 wmv3 编解码器编码的完全相同的 .wmv 文件。我使用以下命令将它们都通过 ffmpeg:
/usr/bin/ffmpeg -i file.wmv -ar 44100 -ab 64k -qscale 9 -s 512x384 -f flv file.flv
一个文件转换得很好,并给了我以下输出:
FFmpeg version SVN-r11070, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic --enable-liba52 --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libxvid --enable-libx264 --enable-pp --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --disable-strip
libavutil version: 49.5.0
libavcodec version: 51.48.0
libavformat version: 51.19.0
built on Jun 25 2008 09:17:38, gcc: 4.1.2 20070925 (Red Hat 4.1.2-33)
Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.97 (30000/1001)
Input #0, asf, from 'ok.wmv':
Duration: 00:14:22.3, start: 3.000000, bitrate: 467 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, stereo, 64 kb/s
Stream #0.1: Video: wmv3, yuv420p, 320x240 [PAR 0:1 DAR 0:1], 400 kb/s, 29.97 tb(r)
Output #0, flv, to 'ok.flv':
Stream #0.0: Video: flv, yuv420p, 512x384 [PAR 0:1 DAR 0:1], q=2-31, 200 kb/s, 29.97 tb(c)
Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
frame=25846 fps=132 q=9.0 Lsize= 88486kB time=862.4 bitrate= 840.5kbits/s
video:80827kB audio:6738kB global headers:0kB muxing overhead 1.050642%
而另一个文件失败:
FFmpeg version SVN-r11070, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic --enable-liba52 --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libxvid --enable-libx264 --enable-pp --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --disable-strip
libavutil version: 49.5.0
libavcodec version: 51.48.0
libavformat version: 51.19.0
built on Jun 25 2008 09:17:38, gcc: 4.1.2 20070925 (Red Hat 4.1.2-33)
[wmv3 @ 0x3700940d20]Extra data: 8 bits left, value: 0
Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, asf, from 'bad3.wmv':
Duration: 00:06:34.9, start: 4.000000, bitrate: 1666 kb/s
Stream #0.0: Audio: 0x0162, 48000 Hz, stereo, 256 kb/s
Stream #0.1: Video: wmv3, yuv420p, 512x384 [PAR 0:1 DAR 0:1], 1395 kb/s, 25.00 tb(r)
File 'ok.flv' already exists. Overwrite ? [y/N] y
Output #0, flv, to 'ok.flv':
Stream #0.0: Video: flv, yuv420p, 512x384 [PAR 0:1 DAR 0:1], q=2-31, 200 kb/s, 25.00 tb(c)
Stream #0.1: Audio: libmp3lame, 48000 Hz, stereo, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Unsupported codec (id=0) for input stream #0.0
我看到的唯一区别是输入音频编解码器
在职的:
Stream #0.0: Audio: wmav2, 44100 Hz, stereo, 64 kb/s
不工作:
Stream #0.0: Audio: 0x0162, 48000 Hz, stereo, 64 kb/s
有任何想法吗?