By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,885 Members | 1,499 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,885 IT Pros & Developers. It's quick & easy.

Video/Audio Capture

P: n/a
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

Oct 2 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
k.*************@gmail.com wrote:
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
Oct 2 '07 #2

P: n/a
On Oct 2, 6:19 pm, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.comwrote:
k.vanderstar...@gmail.com wrote:
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

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

Oct 3 '07 #3

P: n/a
k.*************@gmail.com wrote:
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
Oct 3 '07 #4

P: n/a
On Oct 2, 9:51 pm, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.comwrote:
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

Oct 3 '07 #5

P: n/a
k.*************@gmail.com wrote:
On Oct 2, 9:51 pm, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.comwrote:
>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?
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
Oct 3 '07 #6

P: n/a
On Oct 2, 10:16 pm, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.comwrote:
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

Oct 3 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.