| | 1 | On Windows, we can use the '''[http://ffmpeg.org/ffmpeg.html#vfwcap vfwcap]''' input device to capture live input (such as web camera). NB this is out of date, these days you can use the -f dshow device to capture from a directshow device. |
| | 2 | |
| | 3 | First, we'll try to list the supported capture devices, connected to our machine: |
| | 4 | {{{ |
| | 5 | ffmpeg -y -f vfwcap -i list |
| | 6 | }}} |
| | 7 | |
| | 8 | That will give us the list like this: |
| | 9 | {{{ |
| | 10 | ... |
| | 11 | libavutil 50.36. 0 / 50.36. 0 |
| | 12 | libavcore 0.16. 1 / 0.16. 1 |
| | 13 | libavcodec 52.108. 0 / 52.108. 0 |
| | 14 | libavformat 52.93. 0 / 52.93. 0 |
| | 15 | libavdevice 52. 2. 3 / 52. 2. 3 |
| | 16 | libavfilter 1.74. 0 / 1.74. 0 |
| | 17 | libswscale 0.12. 0 / 0.12. 0 |
| | 18 | [vfwcap @ 01c6d150] Driver 0 |
| | 19 | [vfwcap @ 01c6d150] Microsoft WDM Image Capture (Win32) |
| | 20 | [vfwcap @ 01c6d150] Version: 5.1.2600.5512 |
| | 21 | list: Input/output error |
| | 22 | }}} |
| | 23 | |
| | 24 | Now, we can try to grab something from our camera, with something like this: |
| | 25 | {{{ |
| | 26 | ffmpeg -y -f vfwcap -r 25 -i 0 out.mp4 |
| | 27 | }}} |
| | 28 | |
| | 29 | Where "'''-i 0'''" is the index (zero based) in the list of present capture devices ("'''Driver 0'''"). |