Jump to content
  • Advertisement
Sign in to follow this  
romainechester

video streaming in C#?

This topic is 5013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How oh how is it done?? Hmm... I was thinking of using Media Player... Like the ones that I see in some web sites where they preview some videos and music(blah blah).. Could anyone give me an idea on how I should do this? Puh-lease!!!

Share this post


Link to post
Share on other sites
Advertisement
Actually, DirectShow isn't an option from straight managed C#. You can use it via Interop and the standard DirectX 9 interfaces though.

Here's a blog entry I read some time ago that discusses DirectShow and C#.

Google pulled up these typelibs for using DirectShow via interop.

CodeProject has an article that explores using DirectX 8.1 via interop with C# as well.

Basically -- you'll need to find a managed wrapper written by someone else or instantiate the unmanaged COM version of DirectShow. There's quite a bit of work done on these things out there - some by Microsoft employees themselves - so you might want to dig around a bit.

Share this post


Link to post
Share on other sites
Uhh... what am I supposed to look for in Codeproject.com??


UUUUUhhhhh.... I find what you guys are saying too complex for me to comprehend... I just need my program to be able to play a video clip or two. Maybe in .mpeg format. Uhhh... could you please uhh... explain it again... much more simpler...

Share this post


Link to post
Share on other sites
This is an article at CodeProject that does exactly what you want - it plays a media file in C# and .NET.

There isn't a simple way (without 3rd party controls; that is to say controls you purchase from a vendor whose purpose is very specific, such as playing a video file) to play a video file in C# that I know of.

The above article provides sample code and a sample project. It should get you going.

Share this post


Link to post
Share on other sites
you can always use managed directx AudioVideoPlayback.

using System;
using System.Drawing;
using System.Windows.Forms;
using Microsoft.DirectX.AudioVideoPlayback;

public class Test : Form
{
public Test()
{
Video video = new Video( @"c:\videos\myvideo.mpeg" );
video.Owner = this;
video.Play();
}

public static int Main( string [] args )
{
Application.Run( new Test() );
return 0;
}
};

something like that, dont forget to add reference for microsoft.directx and microsoft.directx.audiovideoplayback assemblies

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!