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 bitrate while streaming #60

Closed
Triuman opened this issue Jan 25, 2017 · 5 comments
Closed

Changing bitrate while streaming #60

Triuman opened this issue Jan 25, 2017 · 5 comments

Comments

@Triuman
Copy link

Triuman commented Jan 25, 2017

Hi,

Is there any chance to implement dynamic bitrate as x264enc supports. After setting pipeline to PLAYING state, even I change the bitrate property of rpicamsrc element, it doesn't change it's output bitrate. I'm coding it in C.

Thank you.

@thaytan
Copy link
Owner

thaytan commented Jan 26, 2017

When I implemented dynamic property changes a while back, I tried the various properties to see which ones the encoder supports changing. Unfortunately, it rejects dynamic bitrate changes. gst-rpicamsrc can't do it without the Rpi firmware supporting it first.

See https://github.com/thaytan/gst-rpicamsrc/blob/master/src/RaspiCapture.c#L1911

@6by9
Copy link

6by9 commented Jan 26, 2017

Correct that you can't change the port format whilst the port is enabled, but MMAL_PARAMETER_VIDEO_BIT_RATE also you to change the bitrate setting at any time.
That's how it is done with the V4L2 driver (https://github.com/raspberrypi/linux/blob/rpi-4.4.y/drivers/media/platform/bcm2835/controls.c#L1103)

status = mmal_port_parameter_set_uint32(encoder_output, MMAL_PARAMETER_VIDEO_BIT_RATE, config->bitrate);

should do it for you.

@Triuman
Copy link
Author

Triuman commented Jan 26, 2017

I added the given line and I can confirm that it's working. This is quite a life saving help. Thank you very much.

@thaytan could you please implement this?

@thaytan
Copy link
Owner

thaytan commented Jan 27, 2017

Oh cool!

@thaytan
Copy link
Owner

thaytan commented Jan 27, 2017

Please let me know if you have any trouble with it

havardgraff pushed a commit to pexip/gst-plugins-good that referenced this issue Jul 15, 2020
Use mmal_port_set_parameter_uint32 to update the encoder
bitrate.

Fixes thaytan/gst-rpicamsrc#60
havardgraff pushed a commit to pexip/gst-plugins-good that referenced this issue Aug 26, 2021
Use mmal_port_set_parameter_uint32 to update the encoder
bitrate.

Fixes thaytan/gst-rpicamsrc#60
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

3 participants