Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing fixed bitrate at runtime #131

Open
ArosPrince opened this issue Jul 23, 2021 · 0 comments
Open

Changing fixed bitrate at runtime #131

ArosPrince opened this issue Jul 23, 2021 · 0 comments

Comments

@ArosPrince
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant