Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-05-2015, 02:55 AM   #1
LQ Newbie
Registered: Feb 2015
Posts: 2

Rep: Reputation: Disabled
Record video from an old webcam using ffmpeg

I've looked through lots of forums alredy but still without finding the solution for my problem. Here is the situation:

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
                    Device Capabilities
            Device Caps   : 0x05000001
                    Video Capture
    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 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':
        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 10 hours - still without working solution - asking for your help.

Thanks in advance.
Old 02-05-2015, 03:08 AM   #2
Senior Member
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Did you checked this page.
Old 02-05-2015, 03:15 AM   #3
LQ Newbie
Registered: Feb 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Sure I did - that's how I've made it to the point where I'm right now.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using FFmpeg to record from TV Card - Video is OK but no audio linux-freak Linux - General 1 01-07-2012 12:55 PM
Record video using laptop webcam hbaromega Linux - Laptop and Netbook 1 01-22-2011 04:49 AM
getting webcam to record sound and video radiodee1 Linux - Software 0 07-22-2008 10:31 AM
What program can I use to record webcam video stream? Balarabay1 Linux - Software 1 12-30-2006 06:20 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:50 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration