2

I am trying to send a H.264 webcam video feed over wifi to another computer using gstreamer. I am using this tutorial as a guide. I am using a Creative Live! Cam Connect HD as my webcam. The website claims that the webcam has on-board H.264 encoder. But when I used v4l2-ctl I get the following:

$ v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
 ...
Index       : 1
Type        : Video Capture
Pixel Format: 'MJPG' (compressed)
Name        : MJPEG

But when I use the --all flag I get a different pixel format.

v4l2-ctl -d 1 --all
Driver Info (not using libv4l2):
Driver name   : uvcvideo
Card type     : Live! Cam Connect HD VF0750
Bus info      : usb-0000:00:14.0-1
Driver version: 3.5.7
Capabilities  : 0x04000001
    Video Capture
    Streaming
Format Video Capture:
Width/Height  : 640/360
Pixel Format  : 'YUYV'
Field         : None
Bytes per Line: 1280
Size Image    : 460800
Colorspace    : SRGB
 ...

I am not sure why I am getting two different pixel formats (MJPG and YUYV) but I was expecting to see Pixel Format: 'H264' (compressed) like in the tutorial I linked to.

I am running Ubuntu 12.1 with kernel version 3.5.0 Does anyone have any idea what my problems it? I would like to use H.264 instead on MJPG to save on bandwidth. Any ideas why it does not detect H.264? Thanks.

3 Answers 3

2

TL;DR: run

v4l2-ctl --list-devices

to check if your camera enumerate multiple instances. H.264 support might be on one of the alternative instances. On my camera I ended up needing to use /dev/video2 instead of video0.

I got this camera (SVPRO Manual Zoom Focus USB Camera 2.8-12mm Lens 1080P HD USB Web Camera 2MP Low Light with Sony IMX322 Sensor Portable USB Camera with Metal Housing).

It claims to support H.264 but when I run

v4l2-ctl --list-formats-ext

I only get MJPG and YUYV formats.

# v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'MJPG' (compressed)
        Name        : Motion-JPEG
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
... 

        Index       : 1
        Type        : Video Capture
        Pixel Format: 'YUYV'
        Name        : YUYV 4:2:2
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
 ...

But then I realized the camera enumerates multiple devices:

# v4l2-ctl --list-devices
H264 USB Camera: USB Camera (usb-0000:00:14.0-3):
        /dev/video0
        /dev/video1
        /dev/video2
        /dev/video3

Apparently H.264 support is on video2:

# v4l2-ctl -d2 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'H264' (compressed)
        Name        : H.264
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)

So I hooked motion to use video2.

0

I think the issue may be that Creative Live! Connect HD cam only supports UVC1.1 which is quite dated; so perhaps the V4l2 driver doesn't recognize it. See Wikipedia's entry for Native h.264 Supported Webcams

1
  • I'm trying both the Creative Live! Cam Connect HD and the Creative Live! Cam Connect HD 1080, and I see the same as mashrur. The message from uvcvideo at connect time says the device is a UVC 1.0 device (not UVC 1.1). This could be causing the difficulty; supposedly H264 was introduced in UVC 1.1. Commented Jul 2, 2014 at 21:17
-1

Two different pixel formats (MJPG and YUYV) show that the camera can support these formats. MPEG for encoded packets(usually used to send across network to receiver end) and YUYV for RAW (uncompressed) image which is usually used for Local Preview. Howver, your can use H.264 in VIDIOC_S_FMT to get H.264 encoded stream.

1
  • Could you provide a link or info detailing how to do this? Commented Feb 26, 2013 at 9:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .