Log in

View Full Version : CBR Bitrate Changing On-the-fly


GEFORCEXTREME
13th April 2010, 08:05
References:
http://x264dev.multimedia.cx/?p=286
https://forum.doom9.org/showthread.php?p=1383940

Hi, with reference to the above, I'm trying out x264_encoder_reconfig to do CBR bitrate changing on-the-fly while transcoding with VLC.

Here's what I did, from VLC's x264.c file, I created a separate threat (at the Open function of VLC's x264.c) that will prompt for user input using printf and scanf repeatedly (yeah, console, I don't know how to do GUI in VLC). I added a callback function to the settings vbv-maxrate and vbv-bufsize (also at Open function of VLC's x264.c). When these value change, the callback function get these values and run x264_encoder_reconfig.

I don't know if I'm doing it the wrong way, but the video doesn't seem to reflect the changes. I know my way of prompting user input using console is flawed but I want to test if this on-the-fly bitrate changing is possible.

Ok, from the reference above, it is said I can change bitrate in CBR mode. But I went through the code and didn't see a CBR mode setting or is CBR mode simply ABR mode with bitrate==vbv_maxrate? If not, how do I enable CBR mode? After enabling CBR mode, how do I change the CBR bitrate? By changing vbv_maxrate and then do x264_encoder_reconfig?

DarkShikari, and anyone, please help. I've been trying this out for like forever.

Thank you in advance.

Dark Shikari
13th April 2010, 10:34
bitrate == maxrate with bufsize set --> CBR

To change the bitrate in CBR mode, change the maxrate and bitrate, and (if applicable) the bufsize. Usually if you want to double the bitrate, for example, you double all three.

GEFORCEXTREME
13th April 2010, 14:02
bitrate == maxrate with bufsize set --> CBR


Does this mean I set bitrate == maxrate with bufsize set and mode to ABR or something like that? Because I don't see the CBR mode, only ABR, CQP and CRF.

Also, can I first set bufsize 0 then change it later? I assume from your description this wouldn't work because I'm not in CBR mode but in ABR mode. Is this correct?

Dark Shikari
13th April 2010, 17:22
bitrate == maxrate with bufsize set --> CBR


Does this mean I set bitrate == maxrate with bufsize set and mode to ABR or something like that?Yes.Also, can I first set bufsize 0 then change it later?No.

GEFORCEXTREME
14th April 2010, 04:01
Thank you very much, DarkShikari. :-) :thanks:

GEFORCEXTREME
15th April 2010, 07:44
Dark Shikari,

The CRF version of the same program have been working flawlessly. Just trancoded a video file with 3 diff quality within the same file and it has been working flawlessly. Thank you.