[FFmpeg-user] a lot of "buffer underflow st=1 bufi=684 size=1152" when mpeg-2 encoding

linxs linxsy at gmail.com
Fri Mar 11 17:56:17 CET 2016


Hi, everyone

I am in trouble when encoding mpg-2.
the command is:
ffmpeg -i legend.mpg -af asetpts=PTS+0.010/TB -c:v mpeg2video -b:v 8M
-maxrate:v 8M -minrate:v 8M   -g 15 -bf 2   -c:a libtwolame -psymodel
4 -b:a 384k  -f dvd -muxrate 8420400 -y out.mpg
Some of video (such as legend.mpg) led to a loto "buffer underflow"
errors, while other lot of video did not.
If I removed the "-muxrate 8420400", the error disappeard, but the
mux_rate was unpredicted.
For the case I am involving in, I need to set all the muxrate of out
mpg the same value.
It seems that error related to ratecontrol.
So I want to know is there any others param to control the bitstream
to fit the defined muxrate?

The legend.mpg is 30M, So I will send it to anybody who can help. (not
send to this maillist).

Thans!


--------------
the error output is :

ffmpeg version N-78843-g1c7e2cf Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl
--enable-version3 --disable-w32threads --enable-avisynth
--enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls
--enable-iconv --enable-libass --enable-libbluray --enable-libbs2b
--enable-libcaca --enable-libdcadec --enable-libfreetype
--enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug
--enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
--enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libspeex --enable-libtheora --enable-libtwolame
--enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg
--enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 27.101 / 57. 27.101
  libavformat    57. 27.100 / 57. 27.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 37.100 /  6. 37.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mpeg, from 'legend.mpg':
  Duration: 00:00:29.83, start: 0.269611, bitrate: 8570 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576
[SAR 16:15 DAR 4:3], 8000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 384 kb/s
[mpeg2video @ 02da75c0] Automatically choosing VBV buffer size of 224 kbyte
Output #0, dvd, to 'out.mpg':
  Metadata:
    encoder         : Lavf57.27.100
    Stream #0:0: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 16:15
DAR 4:3], q=2-31, 8000 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.27.101 mpeg2video
    Side data:
      cpb: bitrate max/min/avg: 8000000/8000000/8000000 buffer size:
1835008 vbv_delay: -1
    Stream #0:1: Audio: mp2 (libtwolame), 48000 Hz, stereo, s16p, 384 kb/s
    Metadata:
      encoder         : Lavc57.27.101 libtwolame
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> mpeg2video (native))
  Stream #0:1 -> #0:1 (mp2 (native) -> mp2 (libtwolame))
Press [q] to stop, [?] for help
[dvd @ 02fe1020] buffer underflow st=1 bufi=1053 size=1152
bitrate=8481.7kbits/s speed=7.49x
[dvd @ 02fe1020] buffer underflow st=0 bufi=51406
size=55893itrate=8454.0kbits/s speed=7.51x
[dvd @ 02fe1020] buffer underflow st=1 bufi=1077 size=1152
[dvd @ 02fe1020] buffer underflow st=0 bufi=53430 size=55893
[dvd @ 02fe1020] buffer underflow st=1 bufi=1077 size=1152
[dvd @ 02fe1020] buffer underflow st=0 bufi=55454 size=55893
[dvd @ 02fe1020] buffer underflow st=1 bufi=1077 size=1152
    Last message repeated 13 times
[dvd @ 02fe1020] buffer underflow st=0 bufi=44518 size=54252
[dvd @ 02fe1020] buffer underflow st=0 bufi=46542 size=54252
[dvd @ 02fe1020] buffer underflow st=0 bufi=48566 size=54252
    Last message repeated 1 times
[dvd @ 02fe1020] buffer underflow st=0 bufi=50590 size=54252
[dvd @ 02fe1020] buffer underflow st=0 bufi=52614 size=54252
[dvd @ 02fe1020] buffer underflow st=1 bufi=1113 size=1152
    Last message repeated 6 times
[dvd @ 02fe1020] buffer underflow st=1 bufi=828 size=1152
    Last message repeated 2 times
[dvd @ 02fe1020] buffer underflow st=1 bufi=1125 size=1152
    Last message repeated 2 times
[dvd @ 02fe1020] buffer underflow st=0 bufi=38814 size=40000
[dvd @ 02fe1020] buffer underflow st=0 bufi=38446 size=52245
    Last message repeated 1 times
[dvd @ 02fe1020] buffer underflow st=0 bufi=40470 size=52245
[dvd @ 02fe1020] buffer underflow st=0 bufi=42494 size=52245
[dvd @ 02fe1020] buffer underflow st=0 bufi=44518 size=52245
[dvd @ 02fe1020] buffer underflow st=0 bufi=46542 size=52245
[dvd @ 02fe1020] buffer underflow st=0 bufi=48566 size=52245
[dvd @ 02fe1020] buffer underflow st=0 bufi=50590 size=52245
[dvd @ 02fe1020] buffer underflow st=0 bufi=24652 size=27755
[dvd @ 02fe1020] buffer underflow st=0 bufi=26676 size=27755
[dvd @ 02fe1020] buffer underflow st=1 bufi=1149 size=1152
    Last message repeated 16 times
[dvd @ 02fe1020] buffer underflow st=0 bufi=39396 size=40000
[dvd @ 02fe1020] buffer underflow st=1 bufi=1149 size=1152
    Last message repeated 40 times
[dvd @ 02fe1020] buffer underflow st=1 bufi=864 size=1152
    Last message repeated 20 times
[dvd @ 02fe1020] buffer underflow st=1 bufi=579 size=1152
    Last message repeated 17 times
[dvd @ 02fe1020] buffer underflow st=1 bufi=294 size=1152
[dvd @ 02fe1020] buffer underflow st=0 bufi=35214 size=40000
[dvd @ 02fe1020] buffer underflow st=0 bufi=37238 size=40000
[dvd @ 02fe1020] buffer underflow st=0 bufi=39262 size=40000
[dvd @ 02fe1020] buffer underflow st=1 bufi=876 size=1152
    Last message repeated 7 times
[dvd @ 02fe1020] buffer underflow st=0 bufi=37713 size=40000
[dvd @ 02fe1020] buffer underflow st=1 bufi=876 size=1152
[dvd @ 02fe1020] buffer underflow st=0 bufi=39737 size=40000
[dvd @ 02fe1020] buffer underflow st=1 bufi=876 size=1152
    Last message repeated 18 times
[dvd @ 02fe1020] buffer underflow st=0 bufi=38188 size=40000
[dvd @ 02fe1020] buffer underflow st=1 bufi=876 size=1152
    Last message repeated 41 times
[dvd @ 02fe1020] buffer underflow st=1 bufi=591 size=1152
    Last message repeated 17 times
........


More information about the ffmpeg-user mailing list