rsmohamad / mjpeg_cam

An alternative to usb_cam package for grabbing mjpeg frames from a webcam
7 stars 7 forks source link

MJPEG-support camera not supported ! #2

Open zlg9folira opened 3 years ago

zlg9folira commented 3 years ago

Have a look:

$ v4l2-ctl --list-formats-ext

ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'JPEG' (compressed)
    Name        : JFIF JPEG
        Size: Discrete 320x240
        Size: Discrete 640x480

This camera works just fine with usb_cam when pixel_format is set to mjpeg instead of yuyv. This however, throws error when used with your package:

process[mjpeg_cam-1]: started with pid [10601]
terminate called after throwing an instance of 'std::runtime_error'
  what():  Webcam does not support MJPEG format. Support for more format need to be added!
[mjpeg_cam-1] process has died [pid 10601, exit code -6, cmd /home/.../catkin_ws/devel/lib/mjpeg_cam/mjpeg_cam __name:=mjpeg_cam __log:=/home/.../.ros/log/70d50742-d20b-11eb-a2fd-ec2e98451131/mjpeg_cam-1.log].
log file: /home/.../.ros/log/70d50742-d20b-11eb-a2fd-ec2e98451131/mjpeg_cam-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done
AnthonyZJiang commented 8 months ago

Pixel Format: 'JPEG' (compressed)

This package looks for a format matching exactly as V4L2_PIX_FMT_MJPEG which is equivalent to MJPG (see https://linuxtv.org/downloads/v4l-dvb-apis/userspace-api/v4l/pixfmt-reserved.html)

Your camera uses JPEG. usb_cam package is more forgiving in formats I think.