Reputation: 746
I am using ffmpeg on Windows 8 and I would like to capture the built-in H264 hardware encoded stream from the Logitech c930e camera. The H264 built-in encoded stream is part of the UVC 1.5 interface.
Using this command I have noticed that the c930e exposes two video pins through DirectShow: 0 and 1.
ffmpeg -report -list_options true -f dshow -i video="Logitech Webcam C930e"
[dshow @ 0000000002d89360] Pin "Capture" (alternative pin name "0")
[dshow @ 0000000002d89360] Pin "Capture" (alternative pin name "1")
It doesn't seem to matter if I choose Pin 0 or 1, I still get raw video from the Logitech c930e webcam. On Linux, the supposed command involves v4l2, but this does not appear to exist in the default Windows version of ffmpeg from http://ffmpeg.zeranoe.com/builds/
Does the default Windows build of ffmpeg support the direct capture of the UVC interface?
This is the closest I have gotten on this journey, but still isn't quite right:
ffmpeg -report -f dshow -i video="Logitech Webcam C930e" -s 1920x1080 -r 30 -video_pin_name 1 -vcodec H264 -c copy -f mp4 Logitechc930eFeed.mp4
As of April 17, 2015 I am still trying to figure this out and have two new pieces of info.
I found this interesting article on Logitech's website instructing the user to change the default Logitech driver to the generic USB Video Device driver: https://support.logitech.com/en_us/article/Install-native-UVC-drivers-for-your-Logitech-webcam?product=a0qi00000069v0MAAQ#
I also found that my C930e had an older firmware (8.0.866), and Logitech recommends updating the firmware to 8.0.875 to fix an unspecified UVC H.264 issue.
So now I have the latest firmware, and am using the generic "USB Video Device" on Windows 8.1.
ffmpeg -list_devices true -f dshow -i
which gives this output:
ffmpeg version N-69608-g9dc45d1 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --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-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --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-lzma --enable-decklink --enable-zlib
libavutil 54. 18.100 / 54. 18.100
libavcodec 56. 21.102 / 56. 21.102
libavformat 56. 19.100 / 56. 19.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 9.103 / 5. 9.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[dshow @ 00000000045c9360] DirectShow video devices (some may be both video and audio devices)
[dshow @ 00000000045c9360] "Logitech Webcam C930e"
[dshow @ 00000000045c9360] Alternative name "@device_pnp_\\?\usb#vid_046d&pid_0843&mi_00#7&3693c0e6&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 00000000045c9360] DirectShow audio devices
[dshow @ 00000000045c9360] "Microphone (Logitech Webcam C930e)"
[dshow @ 00000000045c9360] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{BB8BE70B-4DDC-465F-9247-86E6EC98D627}"
dummy: Immediate exit requested
And this command:
ffmpeg -list_options true -f dshow -i video="Logitech Webcam C930e"
still gives this output:
ffmpeg version N-69608-g9dc45d1 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --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-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --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-lzma --enable-decklink --enable-zlib
libavutil 54. 18.100 / 54. 18.100
libavcodec 56. 21.102 / 56. 21.102
libavformat 56. 19.100 / 56. 19.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 9.103 / 5. 9.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[dshow @ 0000000004469360] DirectShow video device options (from video devices)
[dshow @ 0000000004469360] Pin "Capture" (alternative pin name "0")
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=640x480 fps=5 max s=640x480 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=640x480 fps=5 max s=640x480 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=160x120 fps=5 max s=160x120 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=160x120 fps=5 max s=160x120 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=176x144 fps=5 max s=176x144 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=176x144 fps=5 max s=176x144 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=320x180 fps=5 max s=320x180 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=320x180 fps=5 max s=320x180 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=320x240 fps=5 max s=320x240 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=320x240 fps=5 max s=320x240 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=352x288 fps=5 max s=352x288 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=352x288 fps=5 max s=352x288 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=424x240 fps=5 max s=424x240 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=424x240 fps=5 max s=424x240 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=480x270 fps=5 max s=480x270 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=480x270 fps=5 max s=480x270 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=640x360 fps=5 max s=640x360 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=640x360 fps=5 max s=640x360 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=800x448 fps=5 max s=800x448 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=800x448 fps=5 max s=800x448 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=800x600 fps=5 max s=800x600 fps=24
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=800x600 fps=5 max s=800x600 fps=24
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=848x480 fps=5 max s=848x480 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=848x480 fps=5 max s=848x480 fps=30
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=960x540 fps=5 max s=960x540 fps=15
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=960x540 fps=5 max s=960x540 fps=15
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=1024x576 fps=5 max s=1024x576 fps=15
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=1024x576 fps=5 max s=1024x576 fps=15
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=1280x720 fps=5 max s=1280x720 fps=10
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=1280x720 fps=5 max s=1280x720 fps=10
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=1600x896 fps=5 max s=1600x896 fps=7.5
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=1600x896 fps=5 max s=1600x896 fps=7.5
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=1920x1080 fps=5 max s=1920x1080 fps=5
[dshow @ 0000000004469360] pixel_format=yuyv422 min s=1920x1080 fps=5 max s=1920x1080 fps=5
[dshow @ 0000000004469360] vcodec=mjpeg min s=640x480 fps=5 max s=640x480 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=640x480 fps=5 max s=640x480 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=160x120 fps=5 max s=160x120 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=160x120 fps=5 max s=160x120 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=176x144 fps=5 max s=176x144 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=176x144 fps=5 max s=176x144 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=320x180 fps=5 max s=320x180 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=320x180 fps=5 max s=320x180 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=320x240 fps=5 max s=320x240 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=320x240 fps=5 max s=320x240 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=352x288 fps=5 max s=352x288 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=352x288 fps=5 max s=352x288 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=424x240 fps=5 max s=424x240 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=424x240 fps=5 max s=424x240 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=480x270 fps=5 max s=480x270 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=480x270 fps=5 max s=480x270 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=640x360 fps=5 max s=640x360 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=640x360 fps=5 max s=640x360 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=800x448 fps=5 max s=800x448 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=800x448 fps=5 max s=800x448 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=800x600 fps=5 max s=800x600 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=800x600 fps=5 max s=800x600 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=848x480 fps=5 max s=848x480 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=848x480 fps=5 max s=848x480 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=960x540 fps=5 max s=960x540 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=960x540 fps=5 max s=960x540 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=1024x576 fps=5 max s=1024x576 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=1024x576 fps=5 max s=1024x576 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=1280x720 fps=5 max s=1280x720 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=1280x720 fps=5 max s=1280x720 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=1600x896 fps=5 max s=1600x896 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=1600x896 fps=5 max s=1600x896 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=1920x1080 fps=5 max s=1920x1080 fps=30
[dshow @ 0000000004469360] vcodec=mjpeg min s=1920x1080 fps=5 max s=1920x1080 fps=30
[dshow @ 0000000004469360] Pin "Capture" (alternative pin name "1")
video=Logitech Webcam C930e: Immediate exit requested
Upvotes: 3
Views: 4263
Reputation: 11
Thanks, I could resolve my problem following the link https://support.logitech.com/en_us/article/Install-native-UVC-drivers-for-your-Logitech-webcam?product=a0qi00000069v0MAAQ# you provided from Logitech. In my case (I have A C920 webcam, NOT C930e), in a Windows 7 PC it worked ok with Logitech drivers, but failed in a Windows 8.1 computer.
Executing ffmpeg -f dshow -list_options true -i video="Logitech HD Pro Webcam C920"
did NOT show any h264 stream. After changing the driver, the camera name lost the Logitech in its name (just "HD Pro Webcam C920"), but now detected the h264 stream and ffmpeg could record it.
Upvotes: 1