Log in

View Full Version : VBV buffer size


montreal.simo
31st December 2012, 19:07
Hello,

I want to set the VBV buffer size at the x264 encoder side. usually with ffmpeg, there is vbv-bufsize and vbv-maxrate options to enable single-frame vbv support to cap frames to the same maximum size.

how can i do it with Gstreamer? I find the option vbv-buf-capacity but i dont know how to activate single-frame vbv support?

thank you for your help :)

kieranrk
31st December 2012, 20:49
Make the buffer duration close to one frame in length and x264 will figure it out.

montreal.simo
31st December 2012, 21:31
is exactly what I do, with frame rate of 25fps i configure vbv-buf-capacity = 40ms. but how this configure the frames to the same maximum size ? or i have to fix quality (e,g pass=qual, quantizer= 22) ?

kieranrk
31st December 2012, 22:37
Your buffer size is in bits. You need to choose one in your case such that bufsize/maxrate = 40ms.

montreal.simo
31st December 2012, 23:04
no, the vbv-buf-capacity define the size of the vbv buffer in milliseconds. 40ms is one frame, but this not configure the size of the frame ?

kieranrk
31st December 2012, 23:31
no, the vbv-buf-capacity define the size of the vbv buffer in milliseconds. 40ms is one frame, but this not configure the size of the frame ?

You are wrong.

montreal.simo
31st December 2012, 23:40
can you plz explain more !

thx

Guest
31st December 2012, 23:42
If you are interested in the absolute size of the bit buffer to be sure it will contain your IDR/I frames, then remember that size is (vbv_rate * time), so when you specify the time you thereby set the size as well, or vice versa.

montreal.simo
31st December 2012, 23:46
If you are interested in the absolute size of the bit buffer to be sure it will contain your I frames, then remember that size is (bitrate * time), so when you specify the time you thereby set the size as well.

i use intra-refresh instead IDR-frames, so I frames are disabled.

the size=bitrate*time. so i have to specify the bitrate ?

thx

kieranrk
1st January 2013, 00:08
You need to make sure your buffer size is one frame in size. You do this by making the time the buffer takes to fill equal to the duration of one frame. This is done by setting vbv-bufsize/vbv-maxrate to 0.04 seconds. So example 25kbit bufsize and 1000kbit/s vbv-maxrate. That is how you get single-frame vbv.

montreal.simo
1st January 2013, 00:53
You need to make sure your buffer size is one frame in size. You do this by making the time the buffer takes to fill equal to the duration of one frame. This is done by setting vbv-bufsize/vbv-maxrate to 0.04 seconds. So example 25kbit bufsize and 1000kbit/s vbv-maxrate. That is how you get single-frame vbv.

thank you for the explanation.

I understand perfectly what you are saying. but, in Gstreamer the options vbv-bufsize and vbv-maxrate does not exist. the only option available is vbv-buf-capacity which defines the buffer size in milliseconds.and this is not enough to define the size in bits.

where i need another option to do this.

kieranrk
1st January 2013, 00:56
thank you for the explanation.

I understand perfectly what you are saying. but, in Gstreamer the options vbv-bufsize and vbv-maxrate does not exist. the only option available is vbv-buf-capacity which defines the buffer size in milliseconds.and this is not enough to define the size in bits.

where i need another option to do this.

You should be able to set the vbv-buf-capacity to 40ms and set a bitrate then I would imagine. x264 should do to the right thing I would imagine.

montreal.simo
1st January 2013, 01:08
yep, i agree with you.

thanks for your help