Runtime change of rc_mode (VBR ↔ CBR) not taking effect on AmebaPro2 RTL8735b

Hello,

I am using the RTL8735B (AmebaPro2) board and working with its video encoder. I tried to change the bitrate control mode CBR at static initialization , but it seems no effect occurs on the output stream.

setting: #define V1_CHANNEL 0

#define V1_BPS 2*1024*1024

#define V1_RCMODE 1 // 1: CBR, 2: VBR

I tried to change the bitrate control mode from VBR to CBR and vice versa at runtime, but it seems no effect occurs on the output stream.

 API:   mm_module_ctrl(rtsp2_v1_ctx, CMD_VIDEO_RCMODE,1);

Hi @ravinder

To switch from VBR to CBR, simply update the following definition:

#define V1_RCMODE 1 // 1: CBR, 2: VBR

The difference between CBR and VBR may not be clearly visible from the video output. To better observe the variations, I recommend analyzing by recording MP4 files and view using VLC Media Player: Tools → Codec Information → Statistics.

When comparing the results:

  • The CBR file should have an average bitrate close to your configured target (around 3.1 Mb/s in this case).

  • The VBR file’s average bitrate will vary depending on scene complexity (around 1.1 Mb/s in my test).

You can also try testing both static (no motion) and motion video scenarios.

  1. Static scene:
    VBR ≈ 1.1 Mb/s → lower bitrate, smaller file size.
    CBR ≈ 3.2 Mb/s → constant rate, larger file size.
  2. Motion scene:
    VBR bitrate rises as complexity increases.
    CBR remains near target (~3 Mb/s), regardless of motion.

Test results for your reference,

VBR_CBR_Test.zip (99.3 KB)

Hi @pammyleong

Thank you very much for your answer. I will try as you suggested, but at runtime if I want to switch from VBR to CBR and vice versa, the API call I mentioned is correct or something else I need to try.

Hi @ravinder

Although CMD_VIDEO_RCMODE is defined, it is not implemented in module_video.c. Therefore, using this API has no effect on the video encoder.

Currently, the bitrate control mode (CBR/VBR) cannot be changed at runtime. Each time you need to switch modes, you must update: #define V1_RCMODE 1 // 1: CBR, 2: VBR and recompile.

However, if a runtime update is required, you can implement your own AT command to allow switching between CBR and VBR while the system is running, allowing the mode to be controlled through commands.

When changing parameters such as the bitrate control mode (CBR/VBR), you should take note of the following:

  1. Pause the module linker using like siso_pause.

  2. Stop the video stream:

    mm_module_ctrl(video_v1_ctx, CMD_VIDEO_STREAM_STOP, V1_CHANNEL);
    
    
  3. Apply your changes — update the desired parameters (e.g., rate control mode, bitrate).

  4. Apply and restart the video stream.

  5. Resume the module linker once the configuration is complete.

You may refer to mmf2_video_example_v1_param_change_init.c, specifically the case RESOLUTION_BPS_CHANGE_TEST, as an example of how to modify video parameters dynamically at runtime. You may refer to line 378 onwards on how to create your own AT command.

Hi @pammyleong,

Thank you very much for the detailed clarification and guidance. That makes perfect sense — I’ll follow your suggestion to pause the SISO link, stop the video stream, update parameters, and restart it as shown in the mmf2_video_example_v1_param_change_init.c example.

I appreciate your explanation regarding the CMD_VIDEO_RCMODE and how to extend it via a custom AT command for runtime switching — very helpful!

Thanks again for your support.

1 Like