[FFmpeg-user] VBV buffer size not set - during stream copy

Hans Carlson forbyta at gmx.com
Sat Nov 5 02:23:50 EET 2016


At some point after ffmpeg 2.8.5 I started to see this message when stream 
copying mpg2 videos:

   VBV buffer size not set, using default size of 130KB
   If you want the mpeg file to be compliant to some specification
   Like DVD, VCD or others, make sure you set the correct buffer size

I can provide a sample mpg2 clip if necessary, but I was able to get the 
same behavior by generating a short clip using ffmpeg, then stream copying 
that generated clip (see output below).   If I do the same thing using 
ffmpeg 2.8.5 I don't get any warning message.

What do I need to do to avoid this message?  I'm not even sure what 
option(s) I should use to set the "VBV buffer"... I assume -bufsize and/or 
-maxrate, but I tried setting both and neither made any difference.

And do either of those really need to be set for a stream COPY operation?

Examples:

Generate a 10 sec "blank" video using latest ffmpeg:

   $ ffmpeg -f lavfi -i color=color=red -codec:v mpeg2video -b:v 16384k -bufsize 4096k -maxrate 30000k -t 10 -f vob TEST.mpg
ffmpeg version N-82228-gfb240a6 Copyright (c) 2000-2016 the FFmpeg developers
   built with gcc 4.5.1 (GCC) 20100924 (Red Hat 4.5.1-4)
   configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --disable-debug --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-x11grab --disable-ffplay --disable-ffserver
   libavutil      55. 35.100 / 55. 35.100
   libavcodec     57. 66.101 / 57. 66.101
   libavformat    57. 57.100 / 57. 57.100
   libavdevice    57.  2.100 / 57.  2.100
   libavfilter     6. 66.100 /  6. 66.100
   libswscale      4.  3.100 /  4.  3.100
   libswresample   2.  4.100 /  2.  4.100
   libpostproc    54.  2.100 / 54.  2.100
Input #0, lavfi, from 'color=color=red':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Output #0, vob, to 'TEST.mpg':
   Metadata:
     encoder         : Lavf57.57.100
     Stream #0:0: Video: mpeg2video (Main), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 16384 kb/s, 25 fps, 90k tbn, 25 tbc
     Metadata:
       encoder         : Lavc57.66.101 mpeg2video
     Side data:
       cpb: bitrate max/min/avg: 30000000/0/16384000 buffer size: 4096000 vbv_delay: -1
Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video (native))
Press [q] to stop, [?] for help
frame=  250 fps=0.0 q=2.0 Lsize=      60kB time=00:00:09.92 bitrate=  49.5kbits/s speed=  25x
video:58kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.049180%

Copy video using latest ffmpeg:

   $ ffmpeg -i TEST.mpg -codec copy -f vob TEST-COPY-latest.mpg
ffmpeg version N-82228-gfb240a6 Copyright (c) 2000-2016 the FFmpeg developers
   built with gcc 4.5.1 (GCC) 20100924 (Red Hat 4.5.1-4)
   configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --disable-debug --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-x11grab --disable-ffplay --disable-ffserver
   libavutil      55. 35.100 / 55. 35.100
   libavcodec     57. 66.101 / 57. 66.101
   libavformat    57. 57.100 / 57. 57.100
   libavdevice    57.  2.100 / 57.  2.100
   libavfilter     6. 66.100 /  6. 66.100
   libswscale      4.  3.100 /  4.  3.100
   libswresample   2.  4.100 /  2.  4.100
   libpostproc    54.  2.100 / 54.  2.100
Input #0, mpeg, from 'TEST.mpg':
   Duration: 00:00:09.88, start: 0.540000, bitrate: 49 kb/s
     Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive), 320x240 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
[vob @ 0x9ca9fc0] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, vob, to 'TEST-COPY-latest.mpg':
   Metadata:
     encoder         : Lavf57.57.100
     Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, progressive), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream mapping:
   Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[vob @ 0x9ca9fc0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frame=  250 fps=0.0 q=-1.0 Lsize=      60kB time=00:00:09.92 bitrate=  49.5kbits/s speed=2.01e+03x
video:58kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.049180%

Copy video using ffmpeg 2.8.5 (no messages):

   $ ffmpeg -i TEST.mpg -codec copy -f vob TEST-COPY-2.8.5.mpg
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
   built with gcc 4.5.1 (GCC) 20100924 (Red Hat 4.5.1-4)
   configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --disable-debug --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-x11grab --disable-ffplay --disable-ffserver
   libavutil      54. 31.100 / 54. 31.100
   libavcodec     56. 60.100 / 56. 60.100
   libavformat    56. 40.101 / 56. 40.101
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 40.101 /  5. 40.101
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  2.101 /  1.  2.101
   libpostproc    53.  3.100 / 53.  3.100
Input #0, mpeg, from 'TEST.mpg':
   Duration: 00:00:09.88, start: 0.540000, bitrate: 49 kb/s
     Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 320x240 [SAR 1:1 DAR 4:3], max. 30000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Output #0, vob, to 'TEST-COPY-2.8.5.mpg':
   Metadata:
     encoder         : Lavf56.40.101
     Stream #0:0: Video: mpeg2video, yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, max. 30000 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream mapping:
   Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=  250 fps=0.0 q=-1.0 Lsize=      60kB time=00:00:09.96 bitrate=  49.3kbits/s
video:58kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.049180%


More information about the ffmpeg-user mailing list