Changes between Initial Version and Version 1 of Capture/Webcam


Ignore:
Timestamp:
Jul 4, 2012, 3:46:57 AM (7 years ago)
Author:
burek
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Capture/Webcam

    v1 v1  
     1
     2== Windows ==
     3
     4On Windows, we can use '''[http://ffmpeg.org/ffmpeg.html#vfwcap vfwcap]''' input device to capture live input (such as web camera).
     5
     6First, we'll try to list the supported capture devices, connected to our machine:
     7{{{
     8ffmpeg -y -f vfwcap -i list
     9}}}
     10
     11That will give us the list like this:
     12{{{
     13...
     14  libavutil     50.36. 0 / 50.36. 0
     15  libavcore      0.16. 1 /  0.16. 1
     16  libavcodec    52.108. 0 / 52.108. 0
     17  libavformat   52.93. 0 / 52.93. 0
     18  libavdevice   52. 2. 3 / 52. 2. 3
     19  libavfilter    1.74. 0 /  1.74. 0
     20  libswscale     0.12. 0 /  0.12. 0
     21[vfwcap @ 01c6d150] Driver 0
     22[vfwcap @ 01c6d150]  Microsoft WDM Image Capture (Win32)
     23[vfwcap @ 01c6d150]  Version:  5.1.2600.5512
     24list: Input/output error
     25}}}
     26
     27Now, we can try to grab something from our camera, with something like this:
     28{{{
     29ffmpeg -y -f vfwcap -r 25 -i 0 out.mp4
     30}}}
     31
     32Where "'''-i 0'''" is the index (zero based) in the list of present capture devices ("'''Driver 0'''").
     33
     34== Linux ==
     35
     36On Linux, we can use '''[http://ffmpeg.org/ffmpeg.html#video4linux2 video4linux2]''' input device to capture live input (such as web camera), like this:
     37{{{
     38ffmpeg -f video4linux2 -r 25 -s 640x480 -i /dev/video0 out.avi
     39}}}
     40
     41If you need to set some specific parameters of your camera, you can do that using [http://ivtvdriver.org/index.php/V4l2-ctl v4l2-ctl tool].
     42
     43You can find it in ubuntu/debian package named '''v4l-utils'''.
     44
     45Most probably you'll want to know what frame sizes / frame rates your camera supports and you can do that using: '''v4l2-ctl --list-formats-ext'''
     46
     47Also, you might want to correct brightness, zoom, focus, etc. with:
     48{{{
     49v4l2-ctl -L
     50}}}
     51and
     52{{{
     53v4l2-ctl -c <option>=<value>
     54}}}