views:

502

answers:

4

Hi,

I need to capture an hd video source (hi def tv for instance) and show it in a pc. What should I use? I would prefer a solution with windows and c# but I am open to other options.

Thank you in advance

A: 

Hauppage makes several solutions for capturing video, including capturing HD video. I believe they have drivers for C#.

McWafflestix
Thank you for the answer McWaffleStix, but I'm trying to find a solution that is hardware independent.
Artur Carvalho
what the hell is a "driver for c#"?
SpliFF
+12  A: 

I would recommend VLC or mplayer/mencoder (win32 versions). They can be command-line driven from your C# application. VLC supports any DirectShow capture device and has a significant number of advanced capture, transcoding and publishing options.

Another option is ffmpeg, which is available as a command-line tool or as a binding to C#.

I personally would recommend using a command-line version of one of these tools over the C# binding because all of these programs tend to develop patches and features quite quickly. It's entirely likely the C# binding will be out-of-date relative to the current stable (let alone SVN) build of any of these programs. In addition you will find a lot more documentation in command-line format since this is normally how these tools are used.

Finally it is possible to do this by building your own DirectShow Capture Filter. This option comes with my BIG FAT WARNING that even when using tools like Capture Graph Builder DirectShow is an extremely complex and temperamental beast and requires a lot of experience to do correctly. It also suffers from regular API changes, differences in Windows platforms and poor documentation. Go down this path at your own peril.

SpliFF
Now Im using something with DirectShow to capture a tv source of 640x480px, but its not pretty... And it needs a filter to do the deinterlacing correctly. And its not running smoothly showing some artifacts. I'll give it a try with VLC/mplayer or ffmpeg.
Artur Carvalho
SpliFF do you know Media Foundation? Its said that it will substitute DirectShow. And thank you for all the info.
Artur Carvalho
I know it doesn't work in anything but Vista.. and maybe not even then. It's what I mean about changing APIs, this is like the 4th or 5th time MS have changed the way media works under Windows.
SpliFF
The crappy interlacing problem is solved using VLC. Thank you so much! Still need the hd source (borrowing a PS3 soon) to test, but it works with higher video resolutions, so it seems my problem will be solved very soon.
Artur Carvalho
A: 

First I would look at existing software to do this. For example, Windows Movie Maker can display and capture the output of an HD video camera. mplayer should be able to display a live feed from most capture-cards/cameras (and has a fullscreen option). There are other more complete systems, like ScopeBox, OnLocation, UltraScope, or any NLE software (Adobe Premiere, Final Cut Pro etc). These are aimed at video production, but you don't really mention why you are displaying or capturing the video.

If you want to write something from scratch, the DirectShow API should be a good starting point.

I need to capture an hd video source (hi def tv for instance)

You can't capture from a HD-TV, since it's just a display..

You can capture from a HD video-camera, but you'd need a capture card - Blackmagic Design make a lot of these, the cheapest is their ~$150 "Video Recorder", which can capture via component, their ~$200 "Intensity" card will capture via HDMI (and about any other analogue connection)

You should then be able to record from the BlackMagic card using DirectShow or QuickTime API (support page regarding this). The same should be true for other capture cards (I'm just mentioning BlackMagic because they are one of the better known brands)

One thing to note, if you are capturing HD video (1920x1080p), you are dealing with a lot of data. Most recent computers should handle it fine, but it still requires a lot of CPU and IO speed.

Another thing, you cannot capture from something like a Bluray player, as the HDCP (High-bandwidth Digital Content Protection) system prevents this.

dbr
If you have to tell someone to use DirectShow then they should not be using it. It takes years to learn how to use it correctly and months for even simple tasks. It's different across versions of windows. It's not something to be considered lightly.
SpliFF
Thank you for the info dbr. I know I can't capture from a display, I was talking about an hd tv source.
Artur Carvalho
+1  A: 

Hi Artur,

what is you intended source? A realtime TV-signal, that you want to grab and use, or something allready stored? When you want to use a realtime TV-signal itwillbe difficult, because some TV-channels don't want us to grab it and uses HDCP as a signal protection or other copyprotection methods. You should be awareof that

Andreas Hornig