Question

I am trying to convert an avi file to mpeg, but ffmpeg is giving me these error messages, 'buffer underflow' and 'packet too large'

The command I am using is :

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

  1. Dimensions of video - are there any limitations?

    I have noticed that if I take a video with smaller dimensions it seems to work ok, Is there any way to accommodate files with large dimensions like this?

  2. Frame rate - can ffmpeg pad out videos?

    I also have issues with certain frame rates, the error message tells me that only certain frame rates are supported by the mpeg1 format, can I get ffmpeg to pad out my avi file to account for this?

  3. File size - are there any limitations on the max file size that can be converted?

Thanks, Eamonn

OUTPUT

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%
Was it helpful?

Solution

2592 by 2160 is ~20MB per frame uncompressed. A bit rate of 1200 bits/second will be way too low.

To take your enumerated questions in turn:

1. Dimensions of video - are there any limitations?

FFmpeg has no particular limitation that I'm aware of, but different codec and container formats do often limit the frame size and rate (or the bitrate which implicitly limits the latter two). You should check the specs for the codec and container format you're using.

2. Frame rate - can ffmpeg pad out videos?

As you note and mentioned above, codecs and containers don't always allow arbitrary frame rates. (And playback software may not work correctly even if the codec/container does let you set a crazy frame rate.) FFmpeg will pad videos for you, though. From the docs:

-r[:stream_specifier] fps (input/output,per-stream)
As an output option, duplicate or drop input frames to achieve constant output frame rate fps.

 

3. File size - are there any limitations on the max file size that can be converted?

Not that I'm aware of.

OTHER TIPS

possible size limit but only if a single pass example for encoding (MP4 16/9 HD) with size 100Mio

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top