aire39
Posts: 29
Joined: Sat Sep 23, 2017 10:43 am

720p bitrate limitation (MMAL)?

Tue Nov 20, 2018 6:15 pm

I'm running into an issue where setting the bitrate for a 1280x720 video to 4mbps is seeemingly ignored. The video encodes at most ~1.7mbps.

To be sure this is not some issue with my code I used raspivid to test this and it gives about the same result. Where I set the bitrate to 4 or 10mbps but it never goes passed 1.7mbps.

The only way I was able to do this was when I tested 1080p using raspivid which I was able to see the bitrate change to what I had set.

Anyone have any ideas of what may be going on here? Does the bitrate have a max limit depending on the resolution?

I have tried changing to a constant bitrate rather than variable but constant causes the encoder output port to stop working.

The gop is set to 30
Bitrate at 4mbps (this is not being reached)
Resolution at 1280x720 (720p video)
Pi 3 B+ hardware with a rpi camera v1 being used

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26672
Joined: Sat Jul 30, 2011 7:41 pm

Re: 720p bitrate limitation (MMAL)?

Tue Nov 20, 2018 8:39 pm

If it doesn't need to use all the bitrate, it won't.

What frame rate? Its quite possible that on a basic non-moving scene it simply does not need to use more then 1.8 or so MBits/s. You could try more frequent i-frames, that reduces the temporal compression ability and will use more bitrate.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

aire39
Posts: 29
Joined: Sat Sep 23, 2017 10:43 am

Re: 720p bitrate limitation (MMAL)?

Wed Nov 21, 2018 12:00 am

basic non-moving scene it simply does not need to use more then 1.8 or so MBits/s

That explains what was going on! I did not have much movement in the scene which explains why the encoder is only hitting around 1.8 MBits/s.

Return to “C/C++”