[FFmpeg-user] Record H264 webcam with DirectShow

Aviv Hurvitz aviv.hurvitz at gmail.com
Sat Jul 29 11:25:58 EEST 2017


Now with debug output:

>ffmpeg -y -f dshow -video_size 640x480 -vcodec h264 -framerate 30 -report
-loglevel trace -rtbufsize 100M  -i video="Microsoft LifeCam Front" -vcodec
copy -copyinkf  out1.mp4
ffmpeg started on 2017-07-29 at 11:22:40
Report written to "ffmpeg-20170729-112240.log"
ffmpeg version N-86848-g03a9e6f Copyright (c) 2000-2017 the FFmpeg
developers
  built with gcc 7.1.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-cuda
--enable-cuvid --enable-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-libfreetype
--enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora
--enable-libtwolame --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. 68.100 / 55. 68.100
  libavcodec     57.102.100 / 57.102.100
  libavformat    57. 76.100 / 57. 76.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 95.100 /  6. 95.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with
argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'dshow'.
Reading option '-video_size' ... matched as AVOption 'video_size' with
argument '640x480'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec
('copy' to copy stream)) with argument 'h264'.
Reading option '-framerate' ... matched as AVOption 'framerate' with
argument '30'.
Reading option '-report' ... matched as option 'report' (generate a report)
with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument 'trace'.
Reading option '-rtbufsize' ... matched as AVOption 'rtbufsize' with
argument '100M'.
Reading option '-i' ... matched as input url with argument 'video=Microsoft
LifeCam Front'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec
('copy' to copy stream)) with argument 'copy'.
Reading option '-copyinkf' ... matched as option 'copyinkf' (copy initial
non-keyframes) with argument '1'.
Reading option 'out1.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option report (generate a report) with argument 1.
Applying option loglevel (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input url video=Microsoft LifeCam Front.
Applying option f (force format) with argument dshow.
Applying option vcodec (force video codec ('copy' to copy stream)) with
argument h264.
Successfully parsed a group of options.
Opening an input file: video=Microsoft LifeCam Front.
[dshow @ 0000000002643500] Selecting pin Capture on video
[dshow @ 0000000002643500] Could not RenderStream to connect pins
video=Microsoft LifeCam Front: I/O error



On Fri, Jul 28, 2017 at 8:06 PM, Aviv Hurvitz <aviv.hurvitz at gmail.com>
wrote:

> I’m on a Surface Pro 3 running Windows 10. Trying to record an mp4 from a
> native H.264 stream.
>
> The H.264 video sources are on the second “pin” and I suspect that’s the
> problem. But the first and second pins have the same name, so I don’t know
> how to specify them. I was able to record from the first “pin” by removing
> the “-vcodech264”.
> Here are commands:
>
>
>
>
>
> >>>>>ffmpeg -list_options true -f dshow -i video="Microsoft LifeCam Front"
>
>
>
> ffmpeg version N-86848-g03a9e6f Copyright (c) 2000-2017 the FFmpeg
> developers
>
> built with gcc 7.1.0 (GCC)
>
> configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid
> --enable-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-libfreetype --enable-libgme
> --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
> --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264
> --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy
> --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
> --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. 68.100 / 55. 68.100
>
> libavcodec 57.102.100 / 57.102.100
>
> libavformat 57. 76.100 / 57. 76.100
>
> libavdevice 57. 7.100 / 57. 7.100
>
> libavfilter 6. 95.100 / 6. 95.100
>
> libswscale 4. 7.101 / 4. 7.101
>
> libswresample 2. 8.100 / 2. 8.100
>
> libpostproc 54. 6.100 / 54. 6.100
>
> [dshow @ 0000000000df6ce0] DirectShow video device options (from video
> devices)
>
> [dshow @ 0000000000df6ce0] Pin "Capture" (alternative pin name "Capture")
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=640x360 fps=15 max
> s=640x360 fps=30
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=640x480 fps=15 max
> s=640x480 fps=30
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=480x270 fps=15 max
> s=480x270 fps=30
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=424x240 fps=15 max
> s=424x240 fps=30
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=320x240 fps=15 max
> s=320x240 fps=30
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=320x180 fps=15 max
> s=320x180 fps=30
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=160x120 fps=15 max
> s=160x120 fps=30
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=848x480 fps=15 max
> s=848x480 fps=30
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=1920x1080 fps=15 max
> s=1920x1080 fps=30
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=1280x720 fps=15 max
> s=1280x720 fps=30
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=960x540 fps=15 max
> s=960x540 fps=30
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=2592x1944 fps=15 max
> s=2592x1944 fps=15
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=2592x1728 fps=15 max
> s=2592x1728 fps=15
>
> [dshow @ 0000000000df6ce0] pixel_format=yuyv422 min s=1296x864 fps=15 max
> s=1296x864 fps=30
>
> [dshow @ 0000000000df6ce0] Pin "Capture" (alternative pin name "Capture")
>
> [dshow @ 0000000000df6ce0] vcodec=h264 min s=1920x1080 fps=15 max
> s=1920x1080 fps=30
>
> [dshow @ 0000000000df6ce0] vcodec=h264 min s=1280x720 fps=15 max
> s=1280x720 fps=30
>
> [dshow @ 0000000000df6ce0] vcodec=h264 min s=960x540 fps=15 max s=960x540
> fps=30
>
> [dshow @ 0000000000df6ce0] vcodec=h264 min s=848x480 fps=15 max s=848x480
> fps=30
>
> [dshow @ 0000000000df6ce0] vcodec=h264 min s=640x480 fps=15 max s=640x480
> fps=30
>
> [dshow @ 0000000000df6ce0] vcodec=h264 min s=640x360 fps=15 max s=640x360
> fps=30
>
> [dshow @ 0000000000df6ce0] vcodec=h264 min s=480x270 fps=15 max s=480x270
> fps=30
>
> [dshow @ 0000000000df6ce0] vcodec=h264 min s=424x240 fps=15 max s=424x240
> fps=30
>
> [dshow @ 0000000000df6ce0] vcodec=h264 min s=320x240 fps=15 max s=320x240
> fps=30
>
> [dshow @ 0000000000df6ce0] vcodec=h264 min s=320x180 fps=15 max s=320x180
> fps=30
>
> [dshow @ 0000000000df6ce0] vcodec=h264 min s=160x120 fps=15 max s=160x120
> fps=30
>
> video=Microsoft LifeCam Front: Immediate exit requested
>
>
>
> >>>>ffmpeg -y -f dshow -video_size 640x480 -vcodec h264 -framerate 30
> -report -rtbufsize 100M -i video="Microsoft LifeCam Front" -vcodec copy
> -copyinkf out1.mp4
>
>
>
> ffmpeg started on 2017-07-28 at 19:51:23
>
> Report written to "ffmpeg-20170728-195123.log"
>
> ffmpeg version N-86848-g03a9e6f Copyright (c) 2000-2017 the FFmpeg
> developers
>
> built with gcc 7.1.0 (GCC)
>
> configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid
> --enable-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-libfreetype --enable-libgme
> --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
> --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264
> --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy
> --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
> --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. 68.100 / 55. 68.100
>
> libavcodec 57.102.100 / 57.102.100
>
> libavformat 57. 76.100 / 57. 76.100
>
> libavdevice 57. 7.100 / 57. 7.100
>
> libavfilter 6. 95.100 / 6. 95.100
>
> libswscale 4. 7.101 / 4. 7.101
>
> libswresample 2. 8.100 / 2. 8.100
>
> libpostproc 54. 6.100 / 54. 6.100
>
> [dshow @ 00000000025a34c0] Could not RenderStream to connect pins
>
> video=Microsoft LifeCam Front: I/O error
>


More information about the ffmpeg-user mailing list