OpenWrt Forum Archive

Topic: Logitech C170 + mjpg_streamer doesn't work

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

Everywhere where I can find information about this webcam it worked well, but I can't make it working.
mjpg_streamer all the time shouts about format:

root@cph4:~# /usr/bin/mjpg_streamer --input "input_uvc.so --device /dev/video0 -r 1024x768" --output "output_http.so --port 8080 --www /www/webcam"
MJPG Streamer Version: svn rev: exported
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 1024 x 768
 i: Frames Per Second.: not limited
 i: Format............: JPEG 
 i: TV-Norm...........: DEFAULT
Unable to set format: 1196444237 res: 1024x768
 Init v4L2 failed !! exit fatal 
 i: init_VideoIn failed

I've tried with -y, without, with -n, without and with other resolutions as well. No success.
V4L shows:

root@cph4:~# v4l2-ctl --all -d /dev/video0
Driver Info (not using libv4l2):
    Driver name   : uvcvideo
    Card type     : Webcam C170
    Bus info      : usb-ehci-platform.1-1
    Driver version: 3.10.49
    Capabilities  : 0x84000001
        Video Capture
        Streaming
        Device Capabilities
    Device Caps   : 0x04000001
        Video Capture
        Streaming
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
    Width/Height  : 1024/768
    Pixel Format  : 'MJPG' 
    Field         : None
    Bytes per Line: 0
    Size Image    : 2359296
    Colorspace    : SRGB
Crop Capability Video Capture:
    Bounds      : Left 0, Top 0, Width 1024, Height 768
    Default     : Left 0, Top 0, Width 1024, Height 768
    Pixel Aspect: 1/1
Streaming Parameters Video Capture:
    Capabilities     : timeperframe
    Frames per second: 30.000 (30/1)
    Read buffers     : 0
                     brightness (int)    : min=-64 max=64 step=1 default=0 value=0
                       contrast (int)    : min=0 max=30 step=1 default=13 value=13
                     saturation (int)    : min=0 max=127 step=1 default=38 value=38
                            hue (int)    : min=-16000 max=16000 step=1 default=0 value=0
 white_balance_temperature_auto (bool)   : default=1 value=1
                          gamma (int)    : min=20 max=250 step=1 default=100 value=100
           power_line_frequency (menu)   : min=0 max=2 default=1 value=1
      white_balance_temperature (int)    : min=2800 max=6500 step=1 default=5000 value=5000 flags=inactive
                      sharpness (int)    : min=0 max=100 step=1 default=35 value=35
         backlight_compensation (int)    : min=0 max=1 step=1 default=0 value=0
                  exposure_auto (menu)   : min=0 max=3 default=3 value=3
              exposure_absolute (int)    : min=2 max=5000 step=1 default=312 value=333 flags=inactive
         exposure_auto_priority (bool)   : default=0 value=1
                   pan_absolute (int)    : min=-72000 max=72000 step=3600 default=0 value=0
                  tilt_absolute (int)    : min=-54000 max=54000 step=3600 default=0 value=0
                  zoom_absolute (int)    : min=1 max=2 step=1 default=1 value=1

It supports MJPG so should work.
Other thing is why mjpeg_streamer shows JPEG instead og MJPEG in format?
Have anyone of you guys had any issues with this cam?

(Last edited by px2 on 6 Feb 2015, 01:10)

"Unable to set format: 1196444237 res: 1024x768"

Have you tried a lower res? 640x320

Yes, I did. I've tried 640x480, 320x240 and 1280x720 (just in case) but I think not a res is an issue here. Device supports 1024x768 natively what v4l confirms.

What device are you using? What version of OpenWRT? What was your install process for mjpg_streamer? Did you compile it yourself or just using opkg?

I don't have the C170, but have the C270, C310 and C920. I'll give it a test this weekend to see if I can reproduce your issue.

grayman I use device which points to that webcam, run it from command line at now to debug, because starting as a service didn't work.
Installed:
OpenWrt Barrier Breaker (r43321)
root@cph4:~# opkg list-installed | egrep "v4l|uvc|mjpg"
kmod-video-uvc - 3.10.49-1
libv4l - 1.2.1-2
mjpg-streamer - r182-1
v4l-utils - 1.2.1-2
root@cph4:~#

I appreciate if you can make tests on yours.

post the output of

lsusb
uvcdynctrl -f -d /dev/video0
v4l2-ctl -d /dev/video0 --list-formats
v4l2-ctl -d /dev/video0 --list-formats-ext

Have you tried YUV instead of mjpg?

C170 is not listed at http://www.ideasonboard.org/uvc/
Is the C170 a UVC compliant webcam?

How do I find out whether my camera is a UVC device or not?
-> http://www.ideasonboard.org/uvc/faq/

(Last edited by tmo26 on 6 Feb 2015, 22:35)

dmesg:

[ 1791.970000] usb 2-1: new high-speed USB device number 3 using ehci-platform
[ 1792.200000] uvcvideo: Found UVC 1.00 device Webcam C170 (046d:082b)
[ 1792.210000] input: Webcam C170 as /devices/platform/ehci-platform.1/usb2/2-1/2-1:1.0/input/input1

lsusb:

root@cph4:~# lsusb
Bus 001 Device 002: ID 152d:2329 JMicron Technology Corp. / JMicron USA Technology Corp. JM20329 SATA Bridge
Bus 002 Device 003: ID 046d:082b Logitech, Inc. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

uvcdynctrl:

root@cph4:~# uvcdynctrl -f -d /dev/video0
Listing available frame formats for device /dev/video0:
Pixel format: YUYV (YUV 4:2:2 (YUYV); MIME type: video/x-raw-yuv)
  Frame size: 640x480
    Frame rates: 30, 15
  Frame size: 352x288
    Frame rates: 30, 15
  Frame size: 320x240
    Frame rates: 30, 15
  Frame size: 176x144
    Frame rates: 30, 15
  Frame size: 160x120
    Frame rates: 30, 15
  Frame size: 544x288
    Frame rates: 30, 15
  Frame size: 432x240
    Frame rates: 30, 15
  Frame size: 320x176
    Frame rates: 30, 15
  Frame size: 640x360
    Frame rates: 30, 15
Pixel format: MJPG (MJPEG; MIME type: image/jpeg)
  Frame size: 640x480
    Frame rates: 30, 15
  Frame size: 352x288
    Frame rates: 30, 15
  Frame size: 320x240
    Frame rates: 30, 15
  Frame size: 176x144
    Frame rates: 30, 15
  Frame size: 160x120
    Frame rates: 30, 15
  Frame size: 544x288
    Frame rates: 30, 15
  Frame size: 432x240
    Frame rates: 30, 15
  Frame size: 320x176
    Frame rates: 30, 15
  Frame size: 640x360
    Frame rates: 30, 15
  Frame size: 800x480
    Frame rates: 30, 15
  Frame size: 1024x768
    Frame rates: 30, 15

v4l2-ctl:

root@cph4:~# v4l2-ctl -d /dev/video0 --list-formats
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'YUYV'
    Name        : YUV 4:2:2 (YUYV)

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'MJPG' (compressed)
    Name        : MJPEG

root@cph4:~# v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'YUYV'
    Name        : YUV 4:2:2 (YUYV)
        Size: Discrete 640x480
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 352x288
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 320x240
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 176x144
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 160x120
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 544x288
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 432x240
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 320x176
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 640x360
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'MJPG' (compressed)
    Name        : MJPEG
        Size: Discrete 640x480
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 352x288
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 320x240
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 176x144
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 160x120
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 544x288
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 432x240
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 320x176
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 640x360
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 800x480
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
        Size: Discrete 1024x768
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.067s (15.000 fps)

Yes, I did try -y.

root@cph4:~# /usr/bin/mjpg_streamer --input "input_uvc.so -y --device /dev/video0 -r 640x480" --output "output_http.so --port 8080 --www /www/webcam"MJPG Streamer Version: svn rev: exported
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: not limited
 i: Format............: YUYV
 i: JPEG Quality......: 80
 i: TV-Norm...........: DEFAULT
Unable to set format: 1448695129 res: 640x480
 Init v4L2 failed !! exit fatal 
 i: init_VideoIn failed

I was wondering that maybe cam just doesn't work itself but connected to my laptop with Mint works well with cheese and VLC media player as well.

(Last edited by px2 on 7 Feb 2015, 01:30)

My wc C170 work fine.

dmesg | grep C170
[    9.249951] usb 1-1.2.4.4: Product: Webcam C170
[    9.754070] uvcvideo: Found UVC 1.00 device Webcam C170 (046d:082b)
[    9.773784] input: Webcam C170 as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2.4/1-1.2.4.4/1-1.2.4.4:1.0/input/input1

i install:  kmod-video-uvc, mjpg-streamer

Thank you hoatienii but my doesn't.

Guys any ideas how to make it work?

I gave mjpg_streamer a test just now and had no issues getting to run on trunk (44330) using a C270 camera. The versions are not the same as yours so you might want to consider updating.


 CHAOS CALMER (Bleeding Edge, r44330)
 -----------------------------------------------------
  * 1 1/2 oz Gin            Shake with a glassful
  * 1/4 oz Triple Sec       of broken ice and pour
  * 3/4 oz Lime Juice       unstrained into a goblet.
  * 1 1/2 oz Orange Juice
  * 1 tsp. Grenadine Syrup
 -----------------------------------------------------
root@OpenWrt:~# mjpg_streamer --input "input_uvc.so --device /dev/video0 -r 1024
x768" --output "output_http.so --port 8080 --www /www/webcam"
MJPG Streamer Version: svn rev: exported
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 1024 x 768
 i: Frames Per Second.: not limited
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
i: The format asked unavailable, so the width 960 height 720
 o: www-folder-path...: /www/webcam/
 o: HTTP TCP port.....: 8080
 o: username:password.: disabled
 o: commands..........: enabled

root@OpenWrt:~# opkg list-installed | egrep "v4l|uvc|mjpg"
kmod-video-uvc - 3.14.32-1
mjpg-streamer - r182-4
grayman4hire wrote:

I gave mjpg_streamer a test just now and had no issues getting to run on trunk (44330) using a C270 camera. The versions are not the same as yours so you might want to consider updating.

First of all, the cam is not the same...

C270 != C170

grayman4hire wrote:

I don't have the C170, but have the C270, C310 and C920. I'll give it a test this weekend to see if I can reproduce your issue.

I never said the camera was the same smile

The discussion might have continued from here.