Skip to content

Changing fixed bitrate at runtime #131

Open
@ArosPrince

Description

@ArosPrince

Hi,
I noticed max_bitrate param in config_media_params in config_media.mjs is commented out. I tried putting it back in and bind it with a UI component. So far so good...

But I am not sure what to do in the c++ code to get it working. I tried replacing this call:

if (webrtc::MMALWrapper::Instance()->ReinitEncoderInternal() == true) {

in app_ws_config.cc - apply command hadler (line 612) with this:

if (webrtc::MMALWrapper::Instance()->ReinitEncoderWithBitrate(config_media_->GetMaxBitrate()) == true) {

And defined that function in mmal_wrapper.cc. It just first sets the bitrate and then call ReinitEncoderInternal - nothing special...

It seems to work, but only for a second or so. There seems to be something else running that set's it back to the initial value again.

I was able to figure out that MMALEncoderWrapper::SetRate() is getting called periodically always with the same values, which could be what sets it back. This function gets called from RaspiEncoderImpl::SetRates() but I wasn't able to dig any further. I tried to print the callstack but no matter what I do and with which flags I try to compile, I always only get function addresses but not the symbols.

Any idea what is calling those functions and why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions