1
I'm trying to take a picture from my webcam using FFMpeg.
This is what I'm trying to run:
@echo off
:: Get date and time
for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
set datetime=%ldt:~0,4%_%ldt:~4,2%_%ldt:~6,2%_%ldt:~8,2%_%ldt:~10,2%_%ldt:~12,2%
:: Capture snapshot through DirectShow using FFmpeg and save to disk.
ffmpeg.exe -f dshow -i video="1.3M WebCam" -vframes 1 D:\snapshot_%datetime%.jpg
Output:
ffmpeg version N-63746-gfbaf73a Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 3 2014 22:10:20 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-
libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libope
njpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsox
r --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab -
-enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-
libxavs --enable-libxvid --enable-decklink --enable-zlib
libavutil 52. 89.100 / 52. 89.100
libavcodec 55. 66.100 / 55. 66.100
libavformat 55. 42.100 / 55. 42.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
[dshow @ 0000000002ac0480] Could not run filter
video=1.3M WebCam: Input/output error
Can't figure out where the problem is.
When I run ffmpeg -list_devices true -f dshow -i dummy
, I get:
ffmpeg version N-63746-gfbaf73a Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 3 2014 22:10:20 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-
libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libope
njpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsox
r --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab -
-enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-
libxavs --enable-libxvid --enable-decklink --enable-zlib
libavutil 52. 89.100 / 52. 89.100
libavcodec 55. 66.100 / 55. 66.100
libavformat 55. 42.100 / 55. 42.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
[dshow @ 00000000003103e0] DirectShow video devices
[dshow @ 00000000003103e0] "1.3M WebCam"
[dshow @ 00000000003103e0] DirectShow audio devices
[dshow @ 00000000003103e0] "Microphone (Realtek High Defini"
dummy: Immediate exit requested
I'm getting the same error with my capture device. Still haven't solved it. :-( – Simon East – 2014-07-05T16:08:37.987
possible it was a "crossbar" device [crossbar support was only just added] – rogerdpack – 2015-02-02T23:54:41.020
I don't think that
– senshin – 2014-06-05T23:26:30.990-i video="..."
is valid syntax for ffmpeg. Have you looked at the ffmpeg wiki's entry for webcam capture? It seems like it might help.@senshin Just checked, there should be no problem in there. https://trac.ffmpeg.org/wiki/DirectShow
– RichusX – 2014-06-06T00:05:56.783What's the output of
ffmpeg -list_devices true -f dshow -i dummy
? – llogan – 2014-06-06T01:57:40.643@LordNeckbeard Output: http://pastebin.com/3iY8tjqJ
– RichusX – 2014-06-06T12:08:55.013Sorry, but I have no experience with dshow. I recommend asking for help on the ffmpeg-user mailing list.
– llogan – 2014-06-12T21:13:08.757