blackjack / webcam

Golang webcam library for Linux
MIT License
416 stars 92 forks source link

add support for V4L2_PIX_FMT_MJPEG #39

Open rgl opened 4 years ago

rgl commented 4 years ago

These video-capture cards support mjpeg out-of-the-box, it would be pretty nice to support that format too.

Also the http_mjpeg_streamer/webcam example should also support it, as it no longer needs to compress the image at all, it can just send the data directly from the camera do the http response.

For reference, these are the supported formats, as displayed by the example:

Available formats:
YUYV 4:2:2
Motion-JPEG
Supported frame sizes for format YUYV 4:2:2
640x480
720x480
720x576
800x600
1024x768
1280x720
1360x768
1280x960
1280x1024
1600x1200
1920x1080

I've also have more information about these cards at https://github.com/rgl/usb-hdmi-video-capture (including v4l2-ctl --device /dev/video0 --list-formats-ext --all at https://github.com/rgl/usb-hdmi-video-capture/blob/master/v4l-output.txt).