Skip to content

Low quality images from mjpeg frame extraction #486

@fedes82

Description

@fedes82

Hi Dave, I'm having some issues when trying to capture frames from a mjpeg stream. The thing is the images I get are really low quality jpgs, like this https://imgur.com/a/YY1AS
Using the rapid capture and processing recipe as a guide mi program has to wait for a incoming tcp message to signal when to take the picture and then do a little processing in a separated thread. Images has to be 1920x1080 sized and the best quality possible. It gets aprox. 3 messages per second.
Beside of setting resolution, exposure_mode, exposure compensation, iso, shutter_speed, contrast, brightness and rotation, I use:

camera.sensor_mode=2
camera.start_recording(output, format='mjpeg', quality=100)

When the main gets the signaling message, the write method of output searchs for the jpg magic number to start writing to a buffer, and stops writing to that buffer when it find the magic number again. If the main doesn't receive a signaling message, the output's write method do nothing when called.

So, the questions would be, Can I get better images using frame extraction from mjpeg?, Given the output (3~4 1920x1080 images per second), is capture_continuos a better choice? (on early stages of develpment I couldn't make my system work at that rates, so I changed it to the mjpeg way)
Thanks in advance.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions