jacksonliam / mjpg-streamer

Fork of http://sourceforge.net/projects/mjpg-streamer/
3k stars 1.22k forks source link

PJPG pixel format / Unable to map buffer #300

Open smarcelobr opened 3 years ago

smarcelobr commented 3 years ago

Hi. I am trying using an old Philips SPC230NC webcam, but I had no success in a Raspberry PI:

$ lsusb
Bus 001 Device 010: ID 093a:262c Pixart Imaging, Inc. 

This is the complete output for v4l2-ctl --list-formats-ext:

$ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture

    [0]: 'PJPG' (GSPCA PJPG, compressed)
        Size: Discrete 640x480

I have tried the following command:

pi@raspberrypi:~/mjpg-streamer/mjpg-streamer-experimental $ ./mjpg_streamer -i "./input_uvc.so -fourcc RGB24 -r 640x480" -o "./output_http.so"
MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: -1
 i: Format............: RGB24
 i: JPEG Quality......: 80
 i: TV-Norm...........: DEFAULT
Unable to map buffer: Invalid argument
Init v4L2 failed !! exit fatal
 i: init_VideoIn failed
pi@raspberrypi:~/mjpg-streamer/mjpg-streamer-experimental $ 

When I remove "-fourcc RGB24" or change it to a "-y" the error is:

(...)
 i: Could not obtain the requested pixelformat: YUYV , driver gave us: RGB3
    ... will try to handle this by checking against supported formats. 
    ... Falling back to RGB24 mode (consider using -fourcc RGB24 option). Note that this requires much more CPU power
Unable to map buffer: Invalid argument
jacksonliam commented 3 years ago

I'm not sure about PJPG - maybe it would just work adding it as a supported pixel format alongside JPEG and MJPEG, but I don't have a camera which outputs that so cannot try it