[FFmpeg-user] Capturing video from old webcam

Paweł Kajak pkajak at gmail.com
Thu Feb 5 11:07:33 CET 2015


I've been trying to record video from an old external USB webcam
(Media-Tech MT400 -> 0c45:6029) with ffmpeg.

First thing I've tried was to run to try something that works for the
built-in webcam):

ffmpeg -f v4l2 -i /dev/video1 test.avi

But that returned a following error:

Cannot find a proper format for codec 'none' (id 0), pixel format 'none'
(id -1)
Here is what I get from

v4l2-ctl -d /dev/video1/ --all --list-formats-ext

    Driver Info (not using libv4l2):
            Driver name   : sonixb
            Card type     : USB camera
            Bus info      : usb-0000:04:00.0-1
            Driver version: 3.10.17
            Capabilities  : 0x85000001
                    Video Capture
                    Read/Write
                    Streaming
                    Device Capabilities
            Device Caps   : 0x05000001
                    Video Capture
                    Read/Write
                    Streaming
    Priority: 2
    Video input : 0 (sonixb: ok)
    Format Video Capture:
            Width/Height  : 352/288
            Pixel Format  : 'S910'
            Field         : None
            Bytes per Line: 352
            Size Image    : 126720
            Colorspace    : SRGB
    Streaming Parameters Video Capture:
            Frames per second: invalid (0/0)
            Read buffers     : 2



    ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'S910'
        Name        : S910
                Size: Discrete 160x120
                Size: Discrete 176x144
                Size: Discrete 320x240
                Size: Discrete 352x288

        Index       : 1
        Type        : Video Capture
        Pixel Format: 'BA81'
        Name        : BA81
                Size: Discrete 160x120
                Size: Discrete 176x144
Unfortunately that was not of much help to me, but I tried capturing webcam
output with VLC and recording it which.... WORKED!

I've tried

ffmpeg -i vlc-record[...].avi
on VLC recording which returned following information:


    Input #0, avi, from
'vlc-record-2015-02-05-05h22m52s-v4l2____dev_video1-.avi':
      Duration: 00:00:01.58, start: 0.000000, bitrate: 26937 kb/s
        Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 352x288,
27671 kb/s, 22.10 tbr, 22.10 tbn, 22.10 tbc
I thought that was enough information (rawvideo and yuv420p) led to run
ffmpeg with following arguments (I have found yuv4 using ffmpeg -formats)

ffmpeg -f rawvideo -vcodec yuv4 -i /dev/video1 test.avi
The result was only slightly better than one that I saw after my first
attempt:

    [IMGUTILS @ 0x7fff497d3920] Picture size 0x0 is invalid
    [rawvideo @ 0x9c4720] Could not find codec parameters for stream 0
(Video: yuv4, yuv420p, -4 kb/s): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize'
options
    /dev/video1: could not find codec parameters

Again after some searching and several tries I added -video_size cif option
and.... it WORKED!!??

Well, not really...

   Input #0, rawvideo, from '/dev/video1':
      Duration: N/A, start: 0.000000, bitrate: 30412 kb/s
        Stream #0:0: Video: yuv4, yuv420p, 352x288, 30412 kb/s, 25 tbr, 25
tbn, 25 tbc
    Output #0, avi, to 'test.avi':
      Metadata:
        ISFT            : Lavf55.19.104
        Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 352x288,
q=2-31, 200 kb/s, 25 tbn, 25 tbc
    Stream mapping:
      Stream #0:0 -> #0:0 (yuv4 -> mpeg4)
    Press [q] to stop, [?] for help
    frame=   13 fps=6.3 q=24.8 Lsize=    1064kB time=00:00:00.52
bitrate=16759.3kbits/s
    video:1058kB audio:0kB subtitle:0 global headers:0kB muxing overhead
0.554114%

LED on webcam turned on as during capturing video with VLC but all that was
recorded was TV-like noise which I guess is a sign that rawdata is not
decoded correctly.

So here I am after several hours asking for your help.

Thanks in advance,
Pawel


More information about the ffmpeg-user mailing list