View Full Version : Can you do CBR rate change during encoding?
GEFORCEXTREME
5th August 2010, 10:52
In CRF RC mode, it is possible to reencode to a different CRF factor during transcoding using x264_encoder_reconfig().
I have difficulty doing the same in CBR mode though, can anyone help me?
Thanks in advance.
Dark Shikari
5th August 2010, 10:53
Change maxrate, bufsize, and bitrate accordingly.
To double the bitrate while keeping the same (time-wise) buffer size, for example, double all three.
GEFORCEXTREME
5th August 2010, 11:00
// Set vbv_max_bitrate == bitrate and vbv_buffer size (to force CBR)
i_vbv_max_bitrate = i_bitrate;
i_vbv_buffer_size = i_bitrate;
// Then on user request to new bitrate,
i_bitrate = new_bitrate;
i_vbv_max_bitrate = new_bitrate;
i_vbv_buffer_size = new_bitrate;
x264_encoder_reconfig();
My videos don't seem to reflect the change in the CBR rate change, it seems to stay at the original bitrate, what's wrong? CRF works ok.
GEFORCEXTREME
5th August 2010, 11:05
Thanks for the swift reply Dark Shikari, I appreciate it.
I did that and the rate don't seem to change accordingly. I don't know but my code could be erroneous. Is my way of doing that correct? How does a bufsize come to play in this? What does a bitrate/max_rate = 400 kbps and bufsize = 400 kb differ from one with bufsize = 800 kb? Does that mean if have more frames in the encoding buffer? What does this indicate?
Thanks in advance.
GEFORCEXTREME
5th August 2010, 11:49
Seems like it worked, what was I thinking!
Thanks to all, thanks Dark Shikari! :-)
Dark Shikari
5th August 2010, 19:20
CBR is defined by a buffer size. bufsize / maxrate == the time the client must buffer before starting the stream. bufsize is the maximum amount of data available for the client to keep in its buffer before decoding.
GEFORCEXTREME
6th August 2010, 02:48
Dark Shikari,
Actually I'm using x264 with VLC. So basically I can choose a buffer that is the time "the client must buffer before staring the stream" without knowledge on the implementation of VLC? If let's say the amount of data is low and due to underflow, does the client need to stop and buffer to the correct amount of time defined by bufsize / maxrate? Thank you.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.