[FFmpeg-user] problem with limitng output bitrate and VBV underflow warning

negin tebyani negin.tebyani at gmail.com
Sun Apr 9 11:26:01 EEST 2017


I am using this commad to transcode a video with 12000k bitrate to a lower
bitrate like 300k.

here is my command:

ffmpeg -i 12000.mp4 -movflags faststart -c:v libx264 -x264opts
'keyint=288:min-keyint=24:8x8dct:sliced-threads=0' -deblock 1:1 -flags
+loop -b:v 300k -maxrate 300k -bufsize 1000k -tune psnr  -vf
"scale=-1280:720:flags=spline+full_chroma_inp+full_chroma_int+accurate_rnd+bitexact"
-acodec libfdk_aac -b:a 320k -coder 1 -me_range 16 -sc_threshold 42 -bf 10
-q:v 1 -qmin 0 -qmax 35 -trellis 2 -mbtree 1 -mixed-refs 1 -preset veryslow
video.mp4

I need the bitrate to be 2000, but after using this command and using media
info, I see that bitrate is different from what I specified (2000 for
ecample) and there is a nominal bitrate which is what I specified in my
command.

and during the convert process i get the VBV underflow warning after a
short time passes. until that warning hasn't showed up, the bitrate seems
to be fine. but after that the bitrate starts to get higher.

here is my console output:

[libx264 @ 0x20bb0c0] VBV underflow (frame 2992, -20064 bits)
[libx264 @ 0x20bb0c0] VBV underflow (frame 2993, -13888 bits)
[libx264 @ 0x20bb0c0] VBV underflow (frame 2995, -520 bits)
[libx264 @ 0x20bb0c0] VBV underflow (frame 2996, -992 bits)
[libx264 @ 0x20bb0c0] VBV underflow (frame 2997, -1320 bits)
[libx264 @ 0x20bb0c0] VBV underflow (frame 2998, -9528 bits)
[libx264 @ 0x20bb0c0] VBV underflow (frame 2999, -744 bits)
[mp4 @ 0x20ba1e0] Starting second pass: moving the moov atom to the
beginning of the file
frame= 3000 fps= 13 q=-1.0 Lsize=   18665kB time=00:01:00.01
bitrate=2547.9kbits/s
video:16252kB audio:2346kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.363480%
[libx264 @ 0x20bb0c0] frame I:15    Avg QP:30.80  size: 46683
[libx264 @ 0x20bb0c0] frame P:592   Avg QP:31.14  size: 16537
[libx264 @ 0x20bb0c0] frame B:2393  Avg QP:34.69  size:  2570
[libx264 @ 0x20bb0c0] consecutive B-frames:  0.8%  3.3%  5.4%  9.6%  3.3%
76.2%  0.7%  0.0%  0.6%  0.0%  0.0%
[libx264 @ 0x20bb0c0] mb I  I16..4: 37.0% 48.8% 14.2%
[libx264 @ 0x20bb0c0] mb P  I16..4:  9.1%  9.4%  1.0%  P16..4: 24.2%  7.5%
 5.7%  0.8%  0.1%    skip:42.2%
[libx264 @ 0x20bb0c0] mb B  I16..4:  0.4%  0.2%  0.0%  B16..8: 17.9%  4.2%
 0.7%  direct: 0.9%  skip:75.6%  L0:37.7% L1:49.0% BI:13.3%
[libx264 @ 0x20bb0c0] 8x8 transform intra:46.4% inter:49.8%
[libx264 @ 0x20bb0c0] direct mvs  spatial:99.9% temporal:0.1%
[libx264 @ 0x20bb0c0] coded y,uvDC,uvAC intra: 18.8% 27.9% 7.3% inter: 5.6%
3.5% 0.3%
[libx264 @ 0x20bb0c0] i16 v,h,dc,p: 29% 46% 10% 15%
[libx264 @ 0x20bb0c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 19% 55%  3%  2%
 3%  3%  2%  3%
[libx264 @ 0x20bb0c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 30% 17%  3%  5%
 6%  5%  4%  4%
[libx264 @ 0x20bb0c0] i8c dc,h,v,p: 65% 20%  8%  6%
[libx264 @ 0x20bb0c0] Weighted P-Frames: Y:5.6% UV:4.6%
[libx264 @ 0x20bb0c0] ref P L0: 57.1% 15.8% 13.9%  3.3%  2.4%  1.7%  1.3%
 0.6%  0.6%  0.8%  0.5%  0.4%  0.4%  0.4%  0.4%  0.3%
[libx264 @ 0x20bb0c0] ref B L0: 84.1%  9.0%  2.3%  1.4%  0.6%  0.6%  0.6%
 0.2%  0.2%  0.3%  0.2%  0.2%  0.1%  0.1%  0.1%
[libx264 @ 0x20bb0c0] ref B L1: 96.4%  3.6%
[libx264 @ 0x20bb0c0] kb/s:2218.78


and here is a demo of video:

https://streamable.com/e6dbg


More information about the ffmpeg-user mailing list