2

我在使用 FFmpeg 将 .mov 转换为 .ogg 文件时遇到了一些麻烦。

这个命令应该有效,对吧?

ffmpeg -i test.mov -s 640x320 -vcodec libtheora -acodec libvorbis out.ogv

它给了我这个输出

[0] => FFmpeg version SVN-r0.5.9-4:0.5.9-1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
[1] =>   configuration: --extra-version=4:0.5.9-1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdc1394 --enable-shared --disable-static
[2] =>   libavutil     49.15. 0 / 49.15. 0
[3] =>   libavcodec    52.20. 1 / 52.20. 1
[4] =>   libavformat   52.31. 0 / 52.31. 0
[5] =>   libavdevice   52. 1. 0 / 52. 1. 0
[6] =>   libavfilter    0. 4. 0 /  0. 4. 0
[7] =>   libswscale     0. 7. 1 /  0. 7. 1
[8] =>   libpostproc   51. 2. 0 / 51. 2. 0
[9] =>   built on Jun 10 2012 08:33:06, gcc: 4.4.5
[10] => 
[11] => Seems stream 0 codec frame rate differs from container frame rate: 1200.00 (1200/1) -> 30.00 (30/1)
[12] => Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mov':
[13] =>   Duration: 00:00:06.26, start: 0.000000, bitrate: 809 kb/s
[14] =>     Stream #0.0(und): Video: h264, yuv420p, 480x360, 30 tbr, 600 tbn, 1200 tbc
[15] =>     Stream #0.1(und): Audio: aac, 44100 Hz, mono, s16
[16] => Output #0, ogg, to 'out.ogv':
[17] =>     Stream #0.0(und): Video: libtheora, yuv420p, 640x320, q=2-31, 200 kb/s, 90k tbn, 30 tbc
[18] =>     Stream #0.1(und): Audio: vorbis, 44100 Hz, mono, s16, 64 kb/s
[19] => Stream mapping:
[20] =>   Stream #0.0 -> #0.0
[21] =>   Stream #0.1 -> #0.1
[22] => Press [q] to stop encoding

看起来是对的,对吧?

但是这部电影只有大约1秒长。这是为什么?

我无法访问 ffmpeg2theora,所以请不要建议 :)

4

1 回答 1

3

输入文件的帧速率奇怪且可能错误(1200 fps)

尝试强制输入文件的帧速率:

ffmpeg -r 30 -i test.mov -s 640x320 -vcodec libtheora -acodec libvorbis out.ogv

(参数的顺序很重要)

于 2012-11-13T12:16:56.097 回答