ffmpeg directshow

According to [1] it is now possible:

$ ffmpeg -f dshow -i video=”USB2.0_Camera”:audio=”Microphone (USB Audio Device)” output.mkv

You can discover available device names by using

$ ffmpeg -list_devices true -f dshow -i dummy

and types that each supports via:

$ ffmpeg -list_options true -f dshow -i video=<video device>

And specify a type via:

The video options can be set with -r <framerate> -s <size>.
The audio options can be set with -channels <channels> -sample_size
<sample_size> -sample_rate <sample_rate>.

Example:

ffplay -f dshow -i video=screen-capture-recorder
Ffmpeg can also take directshow as input by creating an avisynth file (.avs file) that itself gets input from a graphedit file, which graphedit file exposes a pin of your capture source or any filter really, ex (“yo.avs”):

DirectShowSource(“push2.GRF”, fps=35, audio=False, framecount=1000000)

Also this note from [1] “The input string is in the format video=<video device name>:audio=<audio device name>. It is possible to have two separate inputs (like -f dshow -i audio=foo -f dshow -i video=bar) but my limited tests had shown a better synchronism when both were used in the same input.”

[1] http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=3&t=27

10 thoughts on “ffmpeg directshow

  1. Pingback: ffmpeg screen capture directshow « Roger's woze

  2. Pingback: ffmpeg capture audio windows « Roger's woze

  3. Pingback: ffmpeg enumerate directshow « Roger's woze

  4. Hi Roger,

    Thanks for the info. Is it possible to do screencapture with dshow? You know how?

    All the best,
    Tim.

  5. Pingback: FFmpeg on Windows | Devendra @ Work

  6. I have a HDMI capture card, and the output combine Video pin and Audio pin together. Following is what ffmpeg shows when I check the available type of capture device:

    [dshow @ 0033c3c0] DirectShow video device options
    [dshow @ 0033c3c0] Pin “???”
    [dshow @ 0033c3c0] min s=720×480 fps=59.9402 max s=720×480 fps=59.9402
    [dshow @ 0033c3c0] min s=720×480 fps=29.97 max s=720×480 fps=29.97
    [dshow @ 0033c3c0] min s=720×576 fps=50 max s=720×576 fps=50
    [dshow @ 0033c3c0] min s=720×576 fps=25 max s=720×576 fps=25
    [dshow @ 0033c3c0] min s=640×480 fps=59.9402 max s=640×480 fps=59.9402
    [dshow @ 0033c3c0] min s=1920×1080 fps=29.97 max s=1920×1080 fps=29.97
    [dshow @ 0033c3c0] min s=1920×1080 fps=25 max s=1920×1080 fps=25
    [dshow @ 0033c3c0] min s=1920×1080 fps=24 max s=1920×1080 fps=24
    [dshow @ 0033c3c0] min s=1280×720 fps=59.9402 max s=1280×720 fps=59.9402
    [dshow @ 0033c3c0] min s=1280×720 fps=50 max s=1280×720 fps=50
    [dshow @ 0033c3c0] Pin “Audio”

    so far I can only capture [s=720×480 fps=59.9402 max s=720×480 fps=59.9402](-s and -r switch doesn’t seems to work) and I cannot capture audio pin. Any ideas?

  7. @bbscool I think that means that your capture device needs “crossbar support” which ffmpeg doesn’t yet have. VLC does though I wonder if the two could merge somehow…

  8. Hi,when I enumerated the device’s options (-list_options) at different computers (all of them are win 7 OS), I got different types of options.

    for example, at A computer, the options are as follows:

    [dshow @ 0033c3c0] DirectShow video device options
    [dshow @ 0033c3c0] Pin “???”
    [dshow @ 0033c3c0] min s=720×480 fps=59.9402 max s=720×480 fps=59.9402
    [dshow @ 0033c3c0] min s=720×480 fps=29.97 max s=720×480 fps=29.97
    [dshow @ 0033c3c0] min s=720×576 fps=50 max s=720×576 fps=50
    [dshow @ 0033c3c0] min s=720×576 fps=25 max s=720×576 fps=25
    [dshow @ 0033c3c0] min s=640×480 fps=59.9402 max s=640×480 fps=59.9402
    [dshow @ 0033c3c0] min s=1920×1080 fps=29.97 max s=1920×1080 fps=29.97
    [dshow @ 0033c3c0] min s=1920×1080 fps=25 max s=1920×1080 fps=25
    [dshow @ 0033c3c0] min s=1920×1080 fps=24 max s=1920×1080 fps=24
    [dshow @ 0033c3c0] min s=1280×720 fps=59.9402 max s=1280×720 fps=59.9402
    [dshow @ 0033c3c0] min s=1280×720 fps=50 max s=1280×720 fps=50

    But at B computer the options probably is:
    [dshow @ 0033c3c0] DirectShow video device options
    [dshow @ 0033c3c0] Pin “???”
    [dshow @ 0033c3c0] min s=720×480 fps=59.9402 max s=720×480 fps=59.9402
    [dshow @ 0033c3c0] min s=720×480 fps=29.97 max s=720×480 fps=29.97
    [dshow @ 0033c3c0] min s=720×576 fps=50 max s=720×576 fps=50
    [dshow @ 0033c3c0] min s=720×576 fps=25 max s=720×576 fps=25
    [dshow @ 0033c3c0] min s=640×480 fps=59.9402 max s=640×480 fps=59.9402

    Do you know why?

Leave a Reply

Your email address will not be published. Required fields are marked *


one × 1 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>