ffmpeg DirectShow capture 2 pins
Asked Answered
C

5

1

Here is ffmpeg DirectShow options

 DirectShow video device options
  Pin "Capture"
   pixel_format=yuyv422  min s=720x480 fps=59.9402 max s=720x480 fps=59.9402
   pixel_format=yuyv422  min s=720x480 fps=29.97 max s=720x480 fps=29.97
   pixel_format=yuyv422  min s=720x576 fps=50 max s=720x576 fps=50
   pixel_format=yuyv422  min s=720x576 fps=25 max s=720x576 fps=25
   pixel_format=yuyv422  min s=640x480 fps=59.9402 max s=640x480 fps=59.9402
   pixel_format=yuyv422  min s=1920x1080 fps=29.97 max s=1920x1080 fps=29.97
   pixel_format=yuyv422  min s=1920x1080 fps=25 max s=1920x1080 fps=25
   pixel_format=yuyv422  min s=1920x1080 fps=24 max s=1920x1080 fps=24
   pixel_format=yuyv422  min s=1280x720 fps=59.9402 max s=1280x720 fps=59.9402
   pixel_format=yuyv422  min s=1280x720 fps=50 max s=1280x720 fps=50
  Pin "Audio"

What ffmpeg command will capture both Pins?

Update

My device name is 7160 HD Capture ffmpeg -f dshow -i video="7160 HD Capture" out.mp4

Following command works fine:-

ffmpeg -f dshow -s 1280x720 -i video="7160 HD Capture" -rtbufsize 2000M out19.mp4

I tried

ffmpeg -f dshow -s 1280x720 -i "video=7160 HD Capture:audio=7160 HD Capture" -rtbufsize 2000M out20.mp4

it does not work and returns error:-

[dshow @ 000000000250b540] Could not enumerate audio devices. video=7160 HD Capture:audio=7160 HD Capture: Input/output error

I seen that audio Pin has different names on different cards. May be I should explicitly name it.

Update 2

GraphEdit

I do not have Audio capture devices but Video Capture definitely has Audio.

I am able to play that audio pin on default audio device

Carlicarlick answered 1/10, 2013 at 9:55 Comment(2)
is this a crossbar device (multiple inputs?)Eby
It is HDMI capture card. Timeleak HD72A or HD75A. I used it to record screen video from mobile phone.Carlicarlick
E
3

OK support for this was (hopefully) added recently in FFmpeg dshow, you can specify ffmpeg -f dshow -i video="AJA Capture Source":audio="AJA Capture Source" now and it work.

There are even new parameters for selecting which pin you want to use, if you need them. https://www.ffmpeg.org/ffmpeg-devices.html#dshow

If it doesn't work for somebody/anybody please let me know [email protected] or comment here.

Eby answered 27/1, 2015 at 20:45 Comment(0)
S
1
ffmpeg.exe -f dshow -s 1920x1080 -i "video=Timeleak HD Capture (YPbPr):audio=Timeleak HD Capture (YPbPr)" -c:v libx264 -preset ultrafast -c:a ac3 -f mpegts udp://127.0.0.1:1234
Spellbind answered 1/3, 2015 at 18:23 Comment(0)
S
0

There is no command that will map both pins from the same instance of the filter. For example, take this command:

ffmpeg.exe -f dshow -i "video=<src_filter_name>:audio=<src_filter_name>"

graphically speaking, it will create two instances of the "src_filter_name" (that beign the name I made up since you didn't provide it in your question). If your filter is nice, and plays with multiple instances of itself, then you'll be OK.

in graph edit try it your self. drop in the source filter twice, and render the audio pin from the first, and the video pin from the second. if that works then the above ffmpeg command should work.

Update

Since your "7160 HD Capture" is not listed under "Audio Capture Sources", ffmpeg will not see it. ffmpeg is written in such a way that it will only read video from the first video pin of a video capture source, and audio from the first audio pin of an audio capture source.

So your options here are

  1. change the way ffmpeg wires up the dshow devices by modifying its source code
  2. create a dshow sink filter into which you send audio and video from the 7160 HD Capture device, and then create a source filter that can act as both an audio and video source for ffmpeg. this would require a process or thread pushing data into the sink and some how making it available to the source.

unfortunately I have no source code to share, just the basic idea. both solutions would be in C++. the directshow way is probably more work, the ffmpeg way is probably easier, if you know and understand ffmpeg source code :-)

Speak answered 1/10, 2013 at 20:23 Comment(3)
Thank You! I have updated with name and commands. Frankly speaking I do not understand much what you say. Thanks to you I found GraphEdit tool. It is very helpful!Carlicarlick
Yeah so basically the "7160 HD Capture" device is seen by DirectShow under "Video Capture Sources", and is NOT listed under "Audio Capture Sources". This means that ffmpeg will not see the audio device either, even though that video device does have an audio pin. ffmpeg is writeen with a very specific scenario in mind, and that is it will get video from a "Video Capture Source", and audio from a "Audio Capture Source".Speak
trac.ffmpeg.org/ticket/5922Tezel
N
0

Use last driver from timeleak.

ffmpeg.exe -f dshow -s 1920x1080 -i "video=Timeleak HD Capture (YPbPr):audio=Timeleak HD Capture (YPbPr)" -f mpegts udp://127.0.0.1:1234

Open udp://@1234 in VLC.

Audio works for me with hd72a via HDMI and I stream in HTTP without a problem.

Nonrepresentational answered 28/2, 2015 at 9:7 Comment(0)
N
0

You can multiplex the 2 capture pins in DirectShow and send the multiplexed stream to ffmpeg.exe with this sink filter.

Nicolanicolai answered 5/3, 2015 at 10:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.