Change bitrate of nvv4l2h264enc on the fly

Continuing the discussion from Change bitrate of nvv4l2h265enc on the fly?:

I want to encode the video stream in a constant bit rate, then I refer to the post for stringent bitrate, it works with change vbv-size . I also want to change the constant bit rate dynamically, then I refer to the post Change bitrate of nvv4l2h265enc on the fly? , but it only works without set vbv-size property. When I change the bit rate, I also need to change the vbv-size. That is:

g_print("Default bit rate is 2Mbps \n");
int vbv_size = 2000000 / 30; // 30 fps
g_object_set (G_OBJECT(encoder), "vbv-size", vbv_size, "bitrate", 2000000, NULL);
g_print("Change bit rate to 4Mbps \n");
vbv_size = 4000000 / 30;
g_object_set (G_OBJECT(encoder), "vbv-size", vbv_size, "bitrate", 4000000, NULL);

Above code is not works. How can I change the constant bitrate dynamically?

This setup may not be supported. Please set to CBR without setting virtual buffer size if you would like to change bitrate in runtime.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.