5

I have an AJA Capture card. The drivers installed with the card include some DirectShow filter. If I pop the filter into GraphEdit I see this:

AJA Capture Filter in GraphEdit

and if I run the ffmpeg command

ffmpeg -f dshow -list_options true -i video="AJA Capture Source"

I see

[dshow @ 0034eec0] DirectShow video device options
[dshow @ 0034eec0]  Pin "Video"
[dshow @ 0034eec0]   pixel_format=yuyv422  min s=720x486 fps=27.2604 max s=1024x
486 fps=29.985
...
[dshow @ 0034eec0]  Pin "Audio 1-2"
[dshow @ 0034eec0]  Pin "Line21"
video=AJA Capture Source: Immediate exit requested

So I see the Video and Audio pins I need. But when I try to run an ffmpeg command to capture both, I can only figure out how to do the video part. How do I hook in to that audio pin? It seems all the examples and documentation point to using a separate audio device, and nothing about hooking into the pins. I'm running it out of a batch file for now like this and I use the ^ to break the line

ffmpeg.exe ^
-y ^
-rtbufsize 100M ^
-f dshow ^
-i video="AJA Capture Source" ^
-t 00:00:10 ^
-aspect 16:9 ^
-c:v libx264 ^
"C:\VCS_AUD_SAMPLE.mp4"

Again, the command above will get me some beautiful video, but I can't figure out the audio part. Is this even supported in ffmpeg or am I going to have to modify the ffmpeg dshow code?

0

4 Answers 4

7

I am the developer of this filter.

Actually the same device is used for both audio and video streams. Moreover, the data for both streams are the result of one function call. Dividing by separate audio and video filters in other cards (example - DeckLink) is artificial (they must be internally connected). Possible reason for division - an attempt to simplify the graph. However, this can lead to other problems (using streams from different devices).

Why ffmpeg can't work with pins of the same filter - not clear to me. This problem of ffmpeg developers.

About only one instance access - very old version of AJA Capture Source filter used. A more recent version of the filter allow you to create multiple instances simultaneously (but only one instance may be in "Play" state). Please, check AJA site for download latest versions of filters. If you like to check latest beta versions of AJA filters, please, write to me at [email protected]

Sign up to request clarification or add additional context in comments.

Comments

4

So after tracing through source code of FFmpeg it was deemed that it could not hook up to multiple pins on a dshow source, so instead of modifying the FFmpeg source, we piped the AJA source pins through two virtual capture sources to achieve the desired result.

3 Comments

Please, share your command. I wish to connect to Audio Pin and I can't find example
I posted it as Questions here stackoverflow.com/questions/19113197/…
Thanks @rogerdpack, but that project was done a long time ago and I no longer have access to the hardware or source.
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.

Comments

1

From http://ffmpeg.org/trac/ffmpeg/wiki/DirectShow

Also this note that "The input string is in the format video=<video device name>:audio=<audio device name>.

So try

ffmpeg.exe -f dshow -i "video=AJA Capture Source:audio=audio source name"

3 Comments

Tried that already. The problem is that the "AJA Capture Source" filter has exclusive access to the hardware, so there can only be one instance of it. So if I try something like video="AJA Capture Source":audio="AJA Capture Source" it will hook up the video and bomb on the audio. It would be great if AJA had one filter dedicated to audio and one to video, but as it is, there seems no way to tell ffmpeg to attach to a pin, rather than a filter.
so you can do one or the other, but not both simultaneously?
yeah, one or the other. i can even take in a filter that belongs the the mic of a web cam. in this case, the AJA filter is both a "Video Capture Source" and "Audio Capture Source" under DirectShow, an only one instance has access to the hardware at a time. this normally wouldn't be an issue in a regular DirectShow setup as a single instance has all the relevant pins, but ffmpeg seems to be set up in such a way that its not pin based, but device based.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.