Video/Audio Capture

  • Thread starter k.vanderstarren
  • Start date
K

k.vanderstarren

Hi Everyone,

Do any of you gurus out there have any suggestions regarding capturing
audio/video from a video capture card in C#. Although I've written
other programs, I've never worked with audio/video sources before.
I've seen other people recommending DirectShow.NET. Is this one of the
more popular libraries to use? Would anyone recommend other third-
party libraries?

Thanks,
Kris
 
P

Peter Duniho

Hi Everyone,

Do any of you gurus out there have any suggestions regarding capturing
audio/video from a video capture card in C#. Although I've written
other programs, I've never worked with audio/video sources before.
I've seen other people recommending DirectShow.NET. Is this one of the
more popular libraries to use? Would anyone recommend other third-
party libraries?

I've only heard of DirectShow.NET. As far as I know (obviously :) ), it
would be your best bet, since it's open-source and has been around long
enough to mature into a nice, usable platform. Granted, I don't have
any personal experience with it...but I've only heard good things about it.

I think for sure, you'll probably want to go with something based on
DirectShow. That's what I've used for video capture, and it's
reasonably well-supported by the various hardware you might run into.
While I haven't used DirectShow in managed code, I've used it in native
Windows stuff and it works as advertised, and provides a flexible API to
use.

One caveat: if you expect to do anything more complicated than just
capturing a/v streams, there are some subtle "gotchas". There's a
Microsoft directx.video newsgroup where you can learn more about those
issues and get help navigating what is basically a simple API but which
has enough varied ways to use it to make it complicated.

Pete
 
K

k.vanderstarren

I've only heard of DirectShow.NET. As far as I know (obviously :) ), it
would be your best bet, since it's open-source and has been around long
enough to mature into a nice, usable platform. Granted, I don't have
any personal experience with it...but I've only heard good things about it.

I think for sure, you'll probably want to go with something based on
DirectShow. That's what I've used for video capture, and it's
reasonably well-supported by the various hardware you might run into.
While I haven't used DirectShow in managed code, I've used it in native
Windows stuff and it works as advertised, and provides a flexible API to
use.

One caveat: if you expect to do anything more complicated than just
capturing a/v streams, there are some subtle "gotchas". There's a
Microsoft directx.video newsgroup where you can learn more about those
issues and get help navigating what is basically a simple API but which
has enough varied ways to use it to make it complicated.

Pete


Thank you very much for the response Pete. The application that I plan
to write needs to record multiple audio/video sources simultaneously.
Generally speaking, as long as the capture card that you've selected
supports multiple inputs, does DirectShow have the flexibility to work
with multiple inputs?

Thanks Again,
Kris
 
P

Peter Duniho

Thank you very much for the response Pete. The application that I plan
to write needs to record multiple audio/video sources simultaneously.
Generally speaking, as long as the capture card that you've selected
supports multiple inputs, does DirectShow have the flexibility to work
with multiple inputs?

Yes, absolutely. The main problem you will run into is bandwidth
issues. But the API itself handles that just fine. The basic paradigm
is a stream graph, with each node having input and output "pins", except
for source nodes that only have output pins and render nodes that only
have input pins.

A graph can have multiple source nodes, or you can just create multiple
graphs, one per source.

Pete
 
K

k.vanderstarren

Yes, absolutely. The main problem you will run into is bandwidth
issues. But the API itself handles that just fine. The basic paradigm
is a stream graph, with each node having input and output "pins", except
for source nodes that only have output pins and render nodes that only
have input pins.

A graph can have multiple source nodes, or you can just create multiple
graphs, one per source.

Excellent - that's exactly what I wanted to hear! One last question if
you don't mind. Does DirectShow handle keeping all of the sources in
sync? In the application that I'm writing I would like the audio
sources (up to five) to stay in syn with the video. Once I've recorded
all of the audio/video streams I plan author them into a DVD so it's
important that the video and audio be synchronized.

Thanks,
Kris
 
P

Peter Duniho

Excellent - that's exactly what I wanted to hear! One last question if
you don't mind. Does DirectShow handle keeping all of the sources in
sync?

Yes and no. A DirectShow graph has a clock that is used to synchronize
all of the filters in the graph. Generally when capturing, the source
filter is used as the sync clock. So DirectShow does have the concept
to keeping various media streams in sync.

That's the "yes". The "no" is that there are certain drift issues that
do still exist. I won't try to detail them here, as much because I
haven't personally run into them as because this is definitely wandering
off-topic for this newsgroup. :)

I do know from reading what others have written on the topic that the
drift is somewhat endemic to the basic problem of capturing a/v data;
DirectShow solves it as best as it can, but there are apparently
fundamental issues that make it impossible to address completely.

For the most part, people who run into those problems are doing
applications that capture streams for very long periods of time (many
hours, if not days). If you are capturing DVD-length stuff, I think
keeping things synchronized shouldn't be an issue.

Pete
 
K

k.vanderstarren

Yes and no. A DirectShow graph has a clock that is used to synchronize
all of the filters in the graph. Generally when capturing, the source
filter is used as the sync clock. So DirectShow does have the concept
to keeping various media streams in sync.

That's the "yes". The "no" is that there are certain drift issues that
do still exist. I won't try to detail them here, as much because I
haven't personally run into them as because this is definitely wandering
off-topic for this newsgroup. :)

I do know from reading what others have written on the topic that the
drift is somewhat endemic to the basic problem of capturing a/v data;
DirectShow solves it as best as it can, but there are apparently
fundamental issues that make it impossible to address completely.

For the most part, people who run into those problems are doing
applications that capture streams for very long periods of time (many
hours, if not days). If you are capturing DVD-length stuff, I think
keeping things synchronized shouldn't be an issue.

Thanks for the excellent information Pete - that's definitely enough
to get me started. Guess it's time to start playing around with
DirectShow now. :)

Cheers,
Kris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top