Capture video from webcam using ffmpeg - finish streaming without any data to written it

1.4k views Asked by At

I have webcam in my computer and ffmpeg 3.3.0 I run this command:

ffmpeg -y -f vfwcap -r 25 -i 0 out1.mp4

I have no errors but the output file is empty.

c:\..\bin>ffmpeg -y -f vfwcap -r 25 -i 0 out1.mp4
ffmpeg version N-87130-g2b9fd15 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7.1.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --e
nable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --
enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-li
bfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug -
-enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enabl
e-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolam
e --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
 --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable
-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
  libavutil      55. 74.100 / 55. 74.100
  libavcodec     57.104.100 / 57.104.100
  libavformat    57. 79.100 / 57. 79.100
  libavdevice    57.  8.100 / 57.  8.100
  libavfilter     6.101.100 /  6.101.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, vfwcap, from '0':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 25 fps,
1k tbr, 1k tbn, 1k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
Finishing stream 0:0 without any data written to it.
[libx264 @ 00000000004f5160] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX FMA3 BMI2 AVX2
[libx264 @ 00000000004f5160] profile High 4:2:2, level 3.0, 4:2:2 8-bit
[libx264 @ 00000000004f5160] 264 - core 152 r2851 ba24899 - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 deci
mate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_
adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=2
5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.6
0 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out1.mp4':
  Metadata:
    encoder         : Lavf57.79.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv422p, 640x480, q=
-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.104.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=
 0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing ove
rhead: unknown
Exiting normally, received signal 2.

c:\..\bin>

My operating system is Windows 7.

0

There are 0 answers