我一直在粉碎我的脑袋一段时间。我有2个完全相同的.wmv文件,用wmv3编解码器编码。我通过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
有什么想法吗?
答案 0 :(得分:4)
实际上是音频格式,这会导致麻烦。音频格式由其TwoCC(此处为0x0162)标识。您可以在此处查找不同的TwoCC:http://wiki.multimedia.cx/index.php?title=TwoCC,您会发现:
0x0162 Windows Media Audio Professional V9
据我所知,ffmpeg和mencoder尚不支持此编解码器。您可以在Google上搜索“ffmpeg audio 0x0162
”并自行检查。
答案 1 :(得分:2)
显而易见的答案是,音频在第二个wmv文件中的编码方式不同,因此它们并不完全相同。您可以尝试强制它为“坏”wmv使用特定的音频编解码器,看看是否有效。也许它只是在选择正确的编解码器时遇到了麻烦?然而,“坏”wmv似乎更有可能具有ffmpeg不支持的某种音频编解码器。
同时尝试常用的东西,确保已升级到最新版本,查看可能包含错误修正的任何开发版本等。
答案 2 :(得分:-1)
或者,使用mencoder