[Ffmpeg-devel] Underflows and overflows with 720p h.264 video

Aaron Williams aaronw
Fri Nov 3 10:47:24 CET 2006


Hi,

I have a 1280x720 h.264 wmv file I am trying to shrink down to 720x480
and am running into a lot of problems with ffmpeg.  I am running ffmpeg
rev 6869 and x264 rev 598.

FFmpeg version SVN-r6869, Copyright (c) 2000-2006 Fabrice Bellard, et al.
  configuration:  --enable-libogg --enable-vorbis --enable-faad
--enable-faac --enable-xvid --enable-x264 --enable-a52 --enable-dts
--enable-dc1394 --enable-gpl --enable-mp3lame --enable-swscaler
--enable-pp --enable-amr_wb --enable-amr_nb --enable-amr_if2
--cpu=athlon64 --enable-shared
  libavutil version: 49.0.2
  libavcodec version: 51.23.0
  libavformat version: 50.6.0
  built on Nov  2 2006 07:52:32, gcc: 4.1.0 (SUSE Linux)
FFmpeg version SVN-r6869, Copyright (c) 2000-2006 Fabrice Bellard, et al.
  configuration:  --enable-libogg --enable-vorbis --enable-faad
--enable-faac --enable-xvid --enable-x264 --enable-a52 --enable-dts
--enable-dc1394 --enable-gpl --enable-mp3lame --enable-swscaler
--enable-pp --enable-amr_wb --enable-amr_nb --enable-amr_if2
--cpu=athlon64 --enable-shared
  libavutil version: 49.0.2
  libavcodec version: 51.23.0
  libavformat version: 50.6.0
  built on Nov  2 2006 07:52:32, gcc: 4.1.0 (SUSE Linux)


ffmpeg -i t_whiteknightstory_tgs06_h264.wmv -s 720x480 -vcodec h264
-acodec copy -b 1500k -maxrate 2400k -bufsize 262144 -flags
+trell+qpel+loop -aspect 16:9 -pass 1 whitenightstory.wmv
FFmpeg version SVN-r6869, Copyright (c) 2000-2006 Fabrice Bellard, et al.
  configuration:  --enable-libogg --enable-vorbis --enable-faad
--enable-faac --enable-xvid --enable-x264 --enable-a52 --enable-dts
--enable-dc1394 --enable-gpl --enable-mp3lame --enable-swscaler
--enable-pp --enable-amr_wb --enable-amr_nb --enable-amr_if2
--cpu=athlon64 --enable-shared
  libavutil version: 49.0.2
  libavcodec version: 51.23.0
  libavformat version: 50.6.0
  built on Nov  2 2006 07:52:32, gcc: 4.1.0 (SUSE Linux)

Seems that stream 1 comes from film source: 1000.00 (1000/1) -> 29.92
(359/12)
Input #0, asf, from 't_whiteknightstory_tgs06_h264.wmv':
  Duration: 00:04:48.1, start: 4.000000, bitrate: 3362 kb/s
  Stream #0.0: Audio: wmav2, 48000 Hz, stereo, 192 kb/s
  Stream #0.1: Video: wmv3, yuv420p, 1280x720, 29.92 fps(r)
File 'whitenightstory.wmv' already exists. Overwrite ? [y/N] y
Output #0, asf, to 'whitenightstory.wmv':
  Stream #0.0: Video: h264, yuv420p, 720x480, q=2-31, pass 1, 1500 kb/s,
29.92 fps(c)
  Stream #0.1: Audio: 0x0161, 48000 Hz, stereo, 192 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
  Stream #0.0 -> #0.1
[h264 @ 0x2b5ec4ddf3f0]using SAR=32/27
[h264 @ 0x2b5ec4ddf3f0]using cpu capabilities MMX MMXEXT SSE SSE2 3DNow!
Press [q] to stop encoding
[h264 @ 0x2b5ec4ddf3f0]OVERFLOW levelcode=4417
[h264 @ 0x2b5ec4ddf3f0]OVERFLOW levelcode=4417
[h264 @ 0x2b5ec4ddf3f0]OVERFLOW levelcode=4417rate=  10.8kbits/s
[h264 @ 0x2b5ec4ddf3f0]OVERFLOW levelcode=4417
[h264 @ 0x2b5ec4ddf3f0]OVERFLOW levelcode=4371rate= 474.2kbits/s
[h264 @ 0x2b5ec4ddf3f0]OVERFLOW levelcode=4371
[h264 @ 0x2b5ec4ddf3f0]OVERFLOW levelcode=4377rate=1226.4kbits/s
[h264 @ 0x2b5ec4ddf3f0]OVERFLOW levelcode=4377
[h264 @ 0x2b5ec4ddf3f0]OVERFLOW levelcode=4377rate=1370.3kbits/s
[h264 @ 0x2b5ec4ddf3f0]OVERFLOW levelcode=4377

then some underflows:
[h264 @ 0x2b5ec4ddf3f0]VBV underflow (-14073 bits)te=1162.0kbits/s
[h264 @ 0x2b5ec4ddf3f0]VBV underflow (-10703 bits)te=1167.0kbits/s
[h264 @ 0x2b5ec4ddf3f0]VBV underflow (-21855 bits)te=1206.3kbits/s
[h264 @ 0x2b5ec4ddf3f0]VBV underflow (-14071 bits)te=1210.9kbits/s
[h264 @ 0x2b5ec4ddf3f0]VBV underflow (-10007 bits)te=1269.6kbits/s
[h264 @ 0x2b5ec4ddf3f0]VBV underflow (-431 bits)rate=1318.6kbits/s
[h264 @ 0x2b5ec4ddf3f0]VBV underflow (-8287 bits)ate=1347.9kbits/s
[h264 @ 0x2b5ec4ddf3f0]VBV underflow (-16743 bits)te=1371.7kbits/s
[h264 @ 0x2b5ec4ddf3f0]VBV underflow (-15427 bits)te=1561.6kbits/s
[h264 @ 0x2b5ec4ddf3f0]VBV underflow (-26029 bits)te=1574.7kbits/s

The resulting wmv file has problems playing back in MPlayer, with the
background which should be black starting out as gray.  After a bit,
MPlayer actually crashes.  I'm not sure where I can upload the source
file since it's 118MB.  I would also shorten it, but ffmpeg does not
seem to want to do that when using -t 00:00:10 -acodec copy -vcodec
copy  It just copies the whole thing.  In the meantime, I have placed a
link to it below, but note I have limited bandwidth.

When trying for MPEG2 instead of H.264 I get buffer underflow errors:

In this case, I used the following command:

ffmpeg -i t_whiteknightstory_tgs06_h264.wmv -vcodec mpeg2video -acodec
mp2 -ab 192 -b 4000k -sameq -s 720x480 -maxrate 5000k -b 3000k -bufsize
16777216 -aspect 16:9 -pass 1 whiteknightstory.mpg

[mpeg @ 0x2ac159533fe0]buffer underflow
(repeated many many times)

The resulting video looks OK in the case of MPEG2, however.

I have placed a copy of the video temporarily at
http://www.doofus.org/aaronw/Video/t_whiteknightstory_tgs06_h264.wmv

I will remove it in a day or so and have limited bandwidth.

I might add that the original video plays just fine with MPlayer. 
ffplay can also play it, but the audio tends to stutter.

-Aaron




More information about the ffmpeg-devel mailing list