1

我正在尝试将 avi 文件转换为 mpeg,但 ffmpeg 给了我这些错误消息,“缓冲区下溢”和“数据包太大”

我使用的命令是:

ffmpeg -I input.avi -s 2592x2160 -b 1200 output.mpg

  1. 视频尺寸 - 有什么限制吗?

    我注意到,如果我拍摄尺寸较小的视频,它似乎可以正常工作,有没有办法容纳这样的大尺寸文件?

  2. 帧速率 - ffmpeg 可以填充视频吗?

    我也有某些帧速率的问题,错误消息告诉我 mpeg1 格式只支持某些帧速率,我可以让 ffmpeg 填充我的 avi 文件来解决这个问题吗?

  3. 文件大小 - 可以转换的最大文件大小是否有任何限制?

谢谢,埃蒙

输出

ffmpeg -i neoAvi.avi -s 2592x2160 -b 1200k neoMpg.mpg
ffmpeg version N-41416-g718607b Copyright (c) 2000-2012 the FFmpeg developers
  built on Jun  8 2012 12:46:19 with gcc 4.6.3
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass
 --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable
-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libope
njpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libth
eora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-
libvorbis --enable-libvpx --ena  libavutil      51. 56.100 / 51. 56.100
  libavcodec     54. 25.100 / 54. 25.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 78.101 /  2. 78.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[avi @ 01d2be20] Something went wrong during header parsing, I will ignore it an
d try to continue anyway.
[avi @ 01d2be20] Stream #0: not enough frames to estimate rate; consider increas
ing probesize
[avi @ 01d2be20] Stream #1: not enough frames to estimate rate; consider increas
ing probesize
[avi @ 01d2be20] Could not find codec parameters (Subtitle: none)
Input #0, avi, from 'neoAvi.avi':
  Duration: 00:00:01.49, start: 0.000000, bitrate: 1493071 kb/s
    Stream #0:0: Video: rawvideo, pal8, 2592x2160, 33.33 tbr, 33.33 tbn, 33.33 t
bc
    Stream #0:1: Subtitle: none
Please use -b:a or -b:v, -b is ambiguous
File 'neoMpg.mpg' already exists. Overwrite ? [y/N] y
[mpeg @ 02ba71a0] packet too large, ignoring buffer limits to mux it
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=921414 size=946200
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=923455 size=946200
[mpeg @ 02ba71a0] packet too large, ignoring buffer limits to mux it
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=923455 size=946200
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=925496 size=946200
[mpeg @ 02ba71a0] packet too large, ignoring buffer limits to mux it
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=925496 size=946200
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=927537 size=946200
...
[mpeg @ 02ba71a0] packet too large, ignoring buffer limits to mux it
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=921414 size=946200
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=923455 size=946200
[mpeg @ 02ba71a0] packet too large, ignoring buffer limits to mux it
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=923455 size=946200
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=925496 size=946200
[mpeg @ 02ba71a0] packet too large, ignoring buffer limits to mux it
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=925496 size=946200
[mpeg @ 02ba71a0] buffer underflow i=0 bufi=927537 size=946200
frame=    4 fps=3.2 q=5.5 size=    1380kB time=00:00:00.06 bitrate=169573.6kbits
frame=   13 fps=7.3 q=29.1 size=    1604kB time=00:00:00.36 bitrate=35836.2kbits
frame=   22 fps=9.5 q=31.0 size=    2100kB time=00:00:00.66 bitrate=25804.8kbits
frame=   31 fps= 11 q=31.0 size=    2490kB time=00:00:00.96 bitrate=21101.5kbits
frame=   40 fps= 12 q=31.0 size=    3010kB time=00:00:01.26 bitrate=19466.8kbits
frame=   47 fps= 12 q=31.0 Lsize=    3128kB time=00:00:01.53 bitrate=16711.7kbit
s/s dup=0 drop=3
video:3116kB audio:0kB global headers:0kB muxing overhead 0.372684%
4

2 回答 2

3

2592 x 2160 每帧未压缩约 20MB。1200 位/秒的比特率太低了。

依次回答您列举的问题:

1. 视频尺寸 - 有什么限制吗?

FFmpeg 没有我知道的特别限制,但不同的编解码器和容器格式确实经常限制帧大小和速率(或隐含限制后两者的比特率)。您应该检查您正在使用的编解码器和容器格式的规范。

2. 帧率——ffmpeg 可以补出视频吗?

正如您在上面提到的,编解码器和容器并不总是允许任意帧速率。(即使编解码器/容器确实让您设置了疯狂的帧速率,播放软件也可能无法正常工作。)不过,FFmpeg 会为您填充视频。从文档

-r[: stream_specifier ] fps ( input/output,per-stream )
作为输出选项,复制或丢弃输入帧以实现恒定的输出帧速率fps

 

3. 文件大小 - 可以转换的最大文件大小是否有任何限制?

不是我知道的。

于 2012-06-14T23:18:48.423 回答
0

可能的大小限制,但仅适用于大小为 100Mio 的单遍编码示例(MP4 16/9 HD)

ffmpeg -y -i "imput.avi" -f mp4 -r 29.97 -vcodec libx264 -preset veryslow -vf setdar=16:9 -fs 100000000 -acodec libvo_aacenc -ab 112k -ar 48000 -ac 2 output.mp4

-fs 100000000 = 100Mio

于 2016-02-07T16:44:47.500 回答