gpt4 book ai didi

video - 为什么使用 ffmpeg 从 wmv 到 flv 的某些转换会失败?

转载 作者:行者123 更新时间:2023-12-04 00:48:58 26 4
gpt4 key购买 nike

一段时间以来,我一直在为这个问题苦恼。我有 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

有什么想法吗?

最佳答案

其实是音频格式的问题。音频格式由其 TwoCC(此处为 0x0162)标识。您可以在此处查找不同的 TwoCC:http://wiki.multimedia.cx/index.php?title=TwoCC你会发现:

0x0162 Windows Media Audio Professional V9

据我所知,ffmpeg 和 mencoder 尚不支持此编解码器。您可以在 google 上搜索“ffmpeg audio 0x0162”并自行检查。

关于video - 为什么使用 ffmpeg 从 wmv 到 flv 的某些转换会失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/87760/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com