Hi rpi forum,
As a bit of background I've been playing with the hardware video encoder in conjunction with an rtmp service, for the most part this has gone well, but I've been unable to constrain the bitrate of the video output to any real degree of success. I am not a developer of any sort, so please excuse any glaring errors in my reasoning going forward.
At first I thought this was down to a command line error on my part, using ffmpeg, but on closer inspection to the source code I suspect the use of OMX_Video_ControlRateVariable is the cause of the wide variation of its resulting output. I've looked at the OpenMAX specification document and found that the following rate control types are defined;
OMX_Video_ControlRateDisable,
OMX_Video_ControlRateVariable,
OMX_Video_ControlRateConstant,
OMX_Video_ControlRateVariableSkipFrames,
OMX_Video_ControlRateConstantSkipFrames,
OMX_Video_ControlRateMax
At this point I went back to first principles and changed the hello_pi/hello_encode source to use OMX_Video_ControlRateConstant. Once compiled it fails to run, hanging and gives no error. I've tried all rate control types and the only ones that work are OMX_Video_ControlRateVariable and OMX_Video_ControlRateVariableSkipFrames.
At this point I thought I'd ask if I'm barking up the wrong tree entirely!
Thanks.
M