DirectShow Capture support

Announcements made by users.
achain
Posts: 1
Joined: Thu May 16, 2013 3:11 pm

Re: DirectShow Capture support

Post by achain » Thu May 16, 2013 4:01 pm

Hi,

Today I bought my Logicool HD Pro Webcam C920.
(note: Logicool is the name of Logitech in Japan).
After reading through this topic, I've tried following command with your
ffmpeg-20130514-git-56ba331-win64-static on Win7 x64:

Code: Select all

ffmpeg -s 640x480 -rtbufsize 100MB -f dshow -vcodec h264 -i video="Logicool HD Pro Webcam C920" -copyinkf -vcodec copy output.mp4
then I got this valid video file output (5.7 mb, 16 sec):
http://61.213.120.67/output.mp4

Can I say things went well?

rogerdpack
Posts: 1877
Joined: Fri Aug 05, 2011 9:56 pm

Re: DirectShow Capture support

Post by rogerdpack » Wed May 29, 2013 11:02 pm

achain wrote:Hi,

Today I bought my Logicool HD Pro Webcam C920.
(note: Logicool is the name of Logitech in Japan).
After reading through this topic, I've tried following command with your
ffmpeg-20130514-git-56ba331-win64-static on Win7 x64:

Code: Select all

ffmpeg -s 640x480 -rtbufsize 100MB -f dshow -vcodec h264 -i video="Logicool HD Pro Webcam C920" -copyinkf -vcodec copy output.mp4
then I got this valid video file output (5.7 mb, 16 sec):
http://61.213.120.67/output.mp4

Can I say things went well?
wow that's awesome. I presume it doesn't work without copyinkf? Does anybody know what this command means/does or why it is needed here?

rogerdpack
Posts: 1877
Joined: Fri Aug 05, 2011 9:56 pm

Re: DirectShow Capture support

Post by rogerdpack » Tue Dec 30, 2014 2:01 pm

I'm going to be doing some hacking on directshow soon [presumably crossbar capture to support analog input devices] any other features/requests I should look at, let me know here, soon!
-roger-

also if you want to try a build that has crossbar support let me know, I have one on my box

rogerdpack
Posts: 1877
Joined: Fri Aug 05, 2011 9:56 pm

Re: DirectShow Capture support

Post by rogerdpack » Mon Jan 26, 2015 8:16 am

OK the dshow crossbar stuff has been merged, check it out, get back to me with any complaint :)

User avatar
Zeranoe
Site Admin
Posts: 704
Joined: Sat May 07, 2011 7:12 pm
Contact:

Re: DirectShow Capture support

Post by Zeranoe » Sun Feb 01, 2015 8:09 pm

rogerdpack wrote:OK the dshow crossbar stuff has been merged, check it out, get back to me with any complaint :)
Great work on this Roger and Ramiro.

I've made this topic a sticky because I consider DShow support to be almost complete in FFmpeg.

sambul92
Posts: 11
Joined: Tue Mar 31, 2015 4:39 am

Re: DirectShow Capture support

Post by sambul92 » Tue Mar 31, 2015 5:19 am

What's the commandline to capture C920 H264 and AAC streams muxed into MP4 without re-encoding or stream over web, while showing a small low res preview window?
-c copy "should" work for the former. No hardware to test it on here, though, GL!

In terms of preview windows,
The only way I can think of it to split it to an SDL out window, or split it to something outputting jpeg's and display the jpeg's back. Typically webcams can't render on both the preview and capture pins [?]

sambul92
Posts: 11
Joined: Tue Mar 31, 2015 4:39 am

Re: DirectShow Capture support

Post by sambul92 » Wed Apr 01, 2015 10:28 pm

I tested with C910 webcam, and -c or -codec option works well to capture mjpeg compressed video and PCM audio to mkv without transcoding. Couldn't test with c920 at the moment.

Code: Select all

ffmpeg -s 1280x720 -framerate 30 -vcodec mjpeg -rtbufsize 100MB -f dshow -i video="Logitech HD Pro Webcam C910":audio="Microphone (HD Pro Webcam C910)" -c copy L:\Video\C910.mkv
As to capturing video and still images for preview, I couldn't make C910 output them simultaneously, but still frames can be captured from video stream with T-splitter or parallel processing. And what's the command to list available formats for Still Image Capture pin?

Also, what's the proper command to list default webcam output formats for all pins? The command

Code: Select all

ffmpeg -f dshow -list_options true -i video="Logitech HD Pro Webcam C910"
lists ALL output options available, while in Linux the following command prints only defaults

Code: Select all

v4l2-ctl --get-fmt-video
Another thing that looks like Dshow bug is audio formats listing. Here is console output:

Code: Select all

ffmpeg -f dshow -list_options true -i audio="Microphone (HD Pro Webcam C910)"
[dshow @ 02ccc200] DirectShow audio only device options (from audio devices)
[dshow @ 02ccc200] Pin "Capture" (alternative pin name "Capture")
[dshow @ 02ccc200] min ch=1 bits=8 rate= 11025 max ch=2 bits=16 rate= 44100
Last message repeated 22 times
audio=Microphone (HD Pro Webcam C910): Immediate exit requested
It shows max 44.1khz sampling rate, and no output format. But VirtualDub gives a lot more detail audio output, maxes out at 96kHz, gives PCM audio format. AMCap maxes out at 48kHz audio. VirtualDub and Dshow video resolution lists for C910 match, of course Dshow names formats in Linux way. When I try to set -sample_rate 48000 for audio capture, the error pops up, but with -sample_rate 41100 it works OK.

Code: Select all

[dshow @ 02b381c0] Could not find audio only device with name [Microphone (HD Pro Webcam C910)] among source devices of type video.
video=Logitech HD Pro Webcam C910:audio=Microphone (HD Pro Webcam C910): Input/output error
Last edited by sambul92 on Tue Apr 14, 2015 4:26 am, edited 16 times in total.

sambul92
Posts: 11
Joined: Tue Mar 31, 2015 4:39 am

Re: DirectShow Capture support

Post by sambul92 » Thu Apr 02, 2015 5:47 pm

rogerdpack wrote:The only way I can think of it to split it to an SDL out window, or split it to something outputting jpeg's and display the jpeg's back.
I posted Webcam Stream Capture with Preview CDL examples here. I was looking for working CDL for quite awhile, so sure it will help novices. At the same time, CPU load at preview is pretty high due to rawvideo encoder either inefficiency or wrong settings, so do you have any feedback on this?

zamar24
Posts: 9
Joined: Sun Apr 19, 2015 6:20 am

Re: DirectShow Capture support

Post by zamar24 » Sun Apr 19, 2015 1:18 pm

I own several Logi webcams, and also feel that Dshow support is incomplete now, for example:

- no command to print only default webcam video, audio, and still image formats data

- no or unknown command to print list of supported still image formats

- the command to print available audio formats gives incomplete list of supported audio sampling rates, and no list of audio stream container formats

Is it possible to add such support to FFMpeg Dshow?

llogan
Posts: 332
Joined: Fri Mar 14, 2014 3:29 am

Re: DirectShow Capture support

Post by llogan » Sun Apr 19, 2015 7:31 pm

If you give/loan one of these devices to rogerdpack he may be able to implement these features. What say ye, roger?

Post Reply
'