PDA

View Full Version : ffmpeg: h264+AC3 to VOB generates "buffer underflow" warnings


omf
15th December 2007, 21:50
I've been playing around with putting AVC video and AC3 audio into a VOB container with ffmpeg (rev. 11143). Whenever I do this, ffmpeg generates thousands of "buffer underflow" warnings. The resulting video is still playable, but I'm wondering if this is something "normal" that everyone is seeing, or if I should be doing something differently.

Here's my command line:
ffmpeg -r 23.976 -f h264 -i video.h264 -f ac3 -i audio.ac3 -vcodec copy -acodec copy -f vob output.vob
And here's what ffmpeg comes back with:
FFmpeg version SVN-r11143, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-liba52 --enable-avisynth --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --cpu=i686 --enable-memalign-hack --extra-ldflags=-static
libavutil version: 49.5.0
libavcodec version: 51.48.0
libavformat version: 52.1.0
built on Dec 3 2007 17:42:57, gcc: 4.2.2 (mingw32)
Input #0, h264, from 'video-HL51.h264':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 1280x720 [PAR 0:1 DAR 0:1], 23.98 tb(r)
Input #1, ac3, from 'audio.ac3':
Duration: 00:43:44.6, bitrate: 640 kb/s
Stream #1.0: Audio: liba52, 48000 Hz, 5:1, 640 kb/s
Output #0, vob, to 'output.vob':
Stream #0.0: Video: libx264, yuv420p, 1280x720 [PAR 0:1 DAR 0:1], q=2-31, 23.98 tb(c)
Stream #0.1: Audio: ac3, 48000 Hz, 5:1, 640 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #1.0 -> #0.1
Press [q] to stop encoding
[vob @ 00ABFB90]buffer underflow i=1 bufi=2397 size=2560
[vob @ 00ABFB90]packet too large, ignoring buffer limits to mux it
[vob @ 00ABFB90]buffer underflow i=1 bufi=2397 size=2560
[vob @ 00ABFB90]buffer underflow i=1 bufi=2237 size=2560
[vob @ 00ABFB90]packet too large, ignoring buffer limits to mux it
... etc...etc... until it finishes with:
[vob @ 00ABFB90]packet too large, ignoring buffer limits to mux it
[vob @ 00ABFB90]buffer underflow i=1 bufi=2296 size=2560
frame=62929 fps=618 q=17036097.5 Lsize= 1518838kB time=2624.6 bitrate=4740.6kbits/s

video:1294848kB audio:205050kB global headers:0kB muxing overhead 1.262777%

Any thoughts or other experiences?

foxyshadis
15th December 2007, 22:43
You don't define any buffer settings, so it's defaulting to DVD specs, which are way too low for HD. If you want to remove the warnings, I think you need -bufsize, but I don't know what the real buffer size is for HD-DVD. (Not that you're very likely to exceed it at that bitrate.)

omf
15th December 2007, 23:07
I think you need -bufsize
That was my first thought, but it didn't seem to matter what value I used for "-bufsize" or what position I put it in the command line, the warning messages didn't change. I expected the "bufi=2296" part of the messages to change and reflect what I was using on the command line, but this didn't change, so I may be using the option incorrectly. Do you have any pointers to examples on using that option?

omf
17th December 2007, 04:55
Just some more notes in case anyone's actually reading this...

I think the reason the -bufsize option on ffmpeg is making no difference is that it's up to the particular codec being used to decide how to use that value. I think the "copy" codec basically ignores the value.

Interestingly, when I had the output type be "mpegts" instead of "vob", the warnings went away. Unfortunately, the resulting TS file was not very useful because TSREMUX reported that it had no PCR codes.

And one other interesting bit: if I mux DTS-HD @ 1536 kb/s instead of AC3 @ 640 kb/s using the exact same command line, then the warnings go away. I expected the higher bitrate of the DTS stream would result in more problems, not fewer!

Back to the drawing board...

Sagekilla
18th December 2007, 22:27
I don't mean to hijack the thread or anything, but you can put AVC into a vob file?

omf
18th December 2007, 22:37
Yes. It's called "AVCHD". The PS3 and some camcorders support it. See here: http://en.wikipedia.org/wiki/Advanced_Video_Codec_High_Definition

Has123
19th December 2007, 02:40
Yes. It's called "AVCHD". The PS3 and some camcorders support it. See here: http://en.wikipedia.org/wiki/Advanced_Video_Codec_High_Definition

Actually vob container is for DVD and not AVCHD. If you are familiar with AVCHD structure it is similar to BD so the stream is either m2ts or MTS container. The h264 in vob container is a work around for the ps3 to play h264 with AC3 as there is currently no reliable way to mux HD h264 video with AC3 (and now the vob trick is broken with 2.1 firmware).

omf
19th December 2007, 11:03
Actually vob container is for DVD and not AVCHD.

Thanks for the clarification. FFMPEG lets you use MPEGTS as a destination container. TSREMUX doesn't like working with that output, though. Has anyone had any luck getting that to work?

survivant001
18th January 2008, 02:50
@omf : did you find your answer how to avoid the underflow problem ?

I try to enore a movie using x264 and when I try to generate a bluray in scenarist I obtain a Underflow error.

I try to mux it -> vob using ffmpeg.. still obtaining the underflow problem.
Most of the time, the movies that I convert are fine.. but this one is not :(

how can I avoid it ?

here the vbv setting of my command line for x264

--vbv-bufsize 14745 --vbv-maxrate 16000 --bitrate 7700