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

add config to enable MJPG encoded stream #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

machinekoder
Copy link
Contributor

This patch allows forcing MJPG steam support of the camera.

Copy link
Collaborator

@furushchev furushchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution.
If I understand correctly, when enable_mjpg is set to true and a camera device supports mjpg, image encoded as mjpg is published directly without decoding to bgr8 (as usual image), right?
If yes, I'm wondering we should use sensor_msgs/CompressedImage message instead of sensor_msgs/Image.
Another question is some image manipulation like cv::flip is supported on mjpg image?

@machinekoder
Copy link
Contributor Author

As far as I understand, this only forces the USB camera to use MJPEG encoding to transport the image from the camera to the PC, which adds additional CPU load to the PC for decoding and of course decreases the stream quality. Depending on the camera this may improve the frame rate of the capture stream. The captured image encoding in OpenCV is not affected by this change.

@machinekoder
Copy link
Contributor Author

@furushchev @awesomebytes Rebased on master. On a new camera I have here, enabling MJPG stream is necessary to unlock all resolutions.

Copy link
Member

@awesomebytes awesomebytes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, what do you think @furushchev

@awesomebytes
Copy link
Member

That said, @machinekoder would you mind adding to the documentation in the README this new option?

@machinekoder
Copy link
Contributor Author

@awesomebytes done

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

Successfully merging this pull request may close these issues.

3 participants