I'm playing around with mmal, creating a video encoder component with encoding set to MMAL_ENCODING_MJPEG.
This seems to be working well, in that I get a series of JPEG images out the other end. My problem is that I can't see any way to set the quality level of the images, and have it stick.
I'm encoding images with a resolution of 640x480 at 30fps. If I set the bitrate of the encoder output port to something low like 100,000bps then I'll get frames encoded to a size of approximately 6400 bytes. Over time however, if I leave the camera running, the encoded size will creep up, and the quality of the encoded images will improve. Eventually, the size of the frames will level out at about 60-70,000bytes. Reading MMAL_PARAMETER_VIDEO_BIT_RATE whilst the encoder is running tells me that the bitrate is still 100,000.
I have tried setting MMAL_PARAMETER_VIDEO_ENCODE_FRAME_LIMIT_BITS to the same as bitrate with no success. Also, setting MMAL_PARAMETER_RATECONTROL to MMAL_VIDEO_RATECONTROL_CONSTANT seems to make no difference.
Can someone please tell me how I should be setting the quality level, and/or bitrate of the MJPEG encoder? If it's any help, I'm using the latest version of the firmware in Hexxeh's github repository (15/4/2014, e65b8c992ad0c2486e172aee1e2b1e98d623d782)
Thanks in advance.