DirectShow MediaPlayer in C#

By Daniel Strigl

This article shows how to play a Media File in a C# Windows Application.
C#.NET 1.0, .NET 1.1, Win2K, WinXPVS.NET2002, VS.NET2003, Dev
Posted: 25 Jul 2002
Updated: 16 Dec 2003
Views: 492,652
Bookmarked: 149 times
Announcements
Want a new Job?
Button Controls
Clipboard
Combo & List Boxes
Dialogs and Windows
Desktop Gadgets
Document / View
Edit Controls
Files and Folders
Grid & Data Controls
List Controls
Menus
Miscellaneous
Printing
Progress Controls
Selection Controls
Shell and IE programming
Smart Client
Splitter Windows
Static & Panel Controls
Status Bar
Tabs & Property Pages
Toolbars & Docking windows
Tree Controls
Ajax and Atlas
Applications & Tools
ASP
ASP.NET
ASP.NET Controls
ATL Server
Caching
Charts, Graphs and Images
Client side scripting
Custom Controls
HTML / CSS
ISAPI
Site & Server Management
Session State
Silverlight
Trace and Logs
User Controls
Validation
View State
WAP / WML
Web Security
Web Services
Content Management Server
Microsoft BizTalk Server
Microsoft Exchange
Office Development
SharePoint Server
Audio and Video
DirectX
GDI
GDI+
General Graphics
OpenGL
Database
SQL Reporting Services
ATL
MFC
STL
WTL
COM / COM+
.NET Framework
Win32/64 SDK & OS
Vista API
Vista Security
Cross Platform
Game Development
Mobile Development
Windows CardSpace
Windows Communication Foundation
Windows Presentation Foundation
Windows Workflow Foundation
Libraries
Windows Powershell
LINQ
C / C++ Language
C++ / CLI
C#
MSIL
VBScript
VB.NET
VB6 Interop
Other .NET Languages
XML
Java
Algorithms & Recipes
Bugs & Workarounds
Collections
Cryptography & Security
Date and Time
DLLs & Assemblies
Exception Handling
Localisation
Macros and Add-ins
Programming Tips
String handling
Internet / Network
Threads, Processes & IPC
WinHelp / HTMLHelp
Expression
Usability
Debug Tips
Design and Architecture
Installation
Work Issues
Testing and QA
Code Generation
Book Chapters
Book Reviews
Hardware Reviews
Interviews
Scrapbook
Hardware & System
Uncategorised Technical Blogs
Product Showcase
Solution Center
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C#
 
Search    
Advanced Search
Add to IE Search
DirectShow MediaPlayer in C#Report       Share   DirectShow MediaPlayer in C#Discuss   DirectShow MediaPlayer in C# Email
61 votes for this article.
DirectShow MediaPlayer in C# DirectShow MediaPlayer in C# DirectShow MediaPlayer in C# DirectShow MediaPlayer in C# DirectShow MediaPlayer in C#DirectShow MediaPlayer in C#
Rating: 4.10 out of 5
DirectShow MediaPlayer in C#
1
DirectShow MediaPlayer in C#
2
DirectShow MediaPlayer in C#
3
DirectShow MediaPlayer in C#
4
DirectShow MediaPlayer in C#
5

DirectShow MediaPlayer in C#

Introduction

Since this is my first article on The Code Project, I would like to apologize for my bad English. It is based only on some "school english" and a few words which I snapped during my leisure job as a Ski Instructor and a Rafting Guide during my education.

I hope everyone can understand this article. Still if questions should exist, I will gladly answer these. And if someone should find some errors, please send me the correct version of the wrong text - thanks for the help when improving my English knowledge spoke ;-).

So, let's start...

This small sample program shows, how simple it is to play a video or an audio track with DirectShow and C#.

The program uses the following controls: MainMenu, ToolBar, StatusBar, Panel, ImageList, and a Timer.

Many of the properties are set using the designer, so I would suggest that you download the project, unless of course you are not a beginner.

On the other side, the sample program includes the DirectShow Interface to play videos or audio tracks.

The program demonstrates the following

  • How to select a media file on the disk, using the OpenFileDialog instance class.
  • How to enable or disable the buttons of the ToolBar Control.
  • How to change the text in the StatusBar Control.
  • How to use a basic Timer.
  • How to use the Events of the Timer Control.
  • How to use the Events of the MainMenu Control.
  • How to use the Events of the ToolBar Control.
  • How to use the Events of the Windows Form.
  • How to play a media file with DirectShow.
  • How to determine, if the media file were finished played.
  • ...

The user interface

Beside the 3 buttons to play and stop a video or an audio track, there are also a menu option to select the desired media file. So, before you can play the desired media file you have to open this file with the "File -> Open..." Command in the MainMenu Control. If the file was duly loaded, it can be played now with the "Play" Button in the ToolBar Control. During playing the video or the audio track, the application shows the current position and the duration of the media file in the StatusBar Control. If the media file were finished played, you can restart playing the media file with the "Play" Button. To select another media file, you can use the "File -> Open..." Command of the MainMenu Control.

DirectShow MediaPlayer in C#DirectShow MediaPlayer in C#

With the "Info" Command of the MainMenu Control the Info-Dialog of the application will be displayed.

DirectShow MediaPlayer in C#

The DirectShow Interface:

To play videos or audio files we use the DirectShow Component of the DirectX Package. With the DirectShow Interface it is very simple to play a video or an audio file, most of the work is doing the Interface for you. You only have to setting up the Interface and calling the Interface methods with the correct parameters.

DirectShow MediaPlayer in C#

Unfortunately .NET and C# is not an officially supported platform for DirectX development and will not be until DirectX 9 is released at the end of the year. However we can use DirectX with C# in the meantime by using the Visual Basic type library's that come with version 7 and 8 of the API. This article demonstrate how to use the DirectX VB Type Lib in C#.

Before we can begin a .NET DirectShow application we need to create a reference to the DirectShow COM DLL. So, copy the "Interop.QuartzTypeLib.dll" DLL into your project folder and add a reference to this DLL. In Visual Studio.NET this is done by choosing Add Reference from the project menu. As next choose the "Browse..." Button of the Add reference Dialog and select the DirectShow COM DLL.

DirectShow MediaPlayer in C#

So, after the reference to the DirectShow COM DLL is created add the following code line to your project, to make the DirectShow Interface Classes visible.

Copy Code
using QuartzTypeLib;

The Code

How to select the media file and create the DirectShow Interface?

After the user pressed the "File -> Open..." Command of the MainMenu Control, a "Open File" Dialog is shown and the user can select the desired media file. In C# this is done by creating a instance of the OpenFileDialog class and call the ShowDialog() function.

Copy Code
new OpenFileDialog();
openFileDialog.Filter = "Media Files|*.mpg;*.avi;*.wma;*.mov;" +
"*.wav;*.mp2;*.mp3|All Files|*.*";
if (DialogResult.OK == openFileDialog.ShowDialog())
{
.
.
.

After the user terminated the dialog with OK, we begin to create the DirectShow Interface and to render the selected media file.

This is done in three steps:

DirectShow MediaPlayer in C#

  1. Create the filter graph manager (FGM)
  2. Create the filter graph (through FGM)
  3. Run the graph and respond to event

In the following code you see how to create the filter graph manager and the filter graph:

Copy Code
CleanUp();
m_objFilterGraph = new FilgraphManager();
m_objFilterGraph.RenderFile(openFileDialog.FileName);
m_objBasicAudio = m_objFilterGraph as IBasicAudio;
try
{
m_objVideoWindow = m_objFilterGraph as IVideoWindow;
m_objVideoWindow.Owner = (int) panel1.Handle;
m_objVideoWindow.WindowStyle = WS_CHILD | WS_CLIPCHILDREN;
m_objVideoWindow.SetWindowPosition(panel1.ClientRectangle.Left,
panel1.ClientRectangle.Top,
panel1.ClientRectangle.Width,
panel1.ClientRectangle.Height);
}
catch (Exception ex)
{
m_objVideoWindow = null;
}
m_objMediaEvent = m_objFilterGraph as IMediaEvent;
m_objMediaEventEx = m_objFilterGraph as IMediaEventEx;
m_objMediaEventEx.SetNotifyWindow((int) this.Handle, WM_GRAPHNOTIFY, 0);
m_objMediaPosition = m_objFilterGraph as IMediaPosition;
m_objMediaControl = m_objFilterGraph as IMediaControl;

With the CleanUp() method we try to delete the old interfaces, if someone exists. Before we can start to render the file we have to create an new instance of the FilterGraphManager with the new method. The RenderFile() method builds a filter graph that renders the specified file. The IBasicAudio Interface is to set the volume and the balance of the sound. With the IVideoWindow Interface you can set the window style, the owner window and the position of video window. This functions are enclosed by a try because, if you render a audio file and you try to set the owner window the method throws an exception. So, to play a audio track we don't need the IVideoWindow Interface and we set the m_objVideoWindow member to null. The IMediaEvent and the IMediaEventEx Interface serves for interception of message, which sends DirectShow to the parent window. With the IMediaPosition Interface the current position of the file can be determined. To start and stop the video or the audio track we use the IMediaControl Interface.

For more information about the Interface read the DirectShow documentation on MSDN.

How to play a media file?

DirectShow MediaPlayer in C#

To start a video or an audio track use the Run() method of the IMediaControl Interface.

Copy Code
m_objMediaControl.Run();

How to break the media file?

DirectShow MediaPlayer in C#

If you want to break the playing video or audio track just use the Pause() method of the IMediaControl Interface.

Copy Code
m_objMediaControl.Pause();

How to stop the media file?

DirectShow MediaPlayer in C#

To stop the video or the audio track use the Stop() method of the IMediaControl Interface.

Copy Code
m_objMediaControl.Stop();

How to get the position and the duration of the media file?

DirectShow MediaPlayer in C#

While the media file is played, we indicate the current position and the length of the file in the StatusBar Control. In addition we read all 100ms the CurrentPosition member of the IMediaPosition Interface over a timer and represent its value in the statusbar. To get the length of the file we read the Duration member of the IMediaPosition Interface.

Copy Code
object sender, System.EventArgs e)
{
if (m_CurrentStatus == MediaStatus.Running)
{
UpdateStatusBar();
}
}

The timer function calls every 100ms the UpdateStatusBar() method, who is displaying the current position and and the duration of the media files in the panels of the statusbar.

Copy Code
void UpdateStatusBar()
{
switch (m_CurrentStatus)
{
case MediaStatus.None   : statusBarPanel1.Text = "Stopped"; break;
case MediaStatus.Paused : statusBarPanel1.Text = "Paused "; break;
case MediaStatus.Running: statusBarPanel1.Text = "Running"; break;
case MediaStatus.Stopped: statusBarPanel1.Text = "Stopped"; break;
}
if (m_objMediaPosition != null)
{
int s = (int) m_objMediaPosition.Duration;
int h = s / 3600;
int m = (s  - (h * 3600)) / 60;
s = s - (h * 3600 + m * 60);
statusBarPanel2.Text = String.Format("{0:D2}:{1:D2}:{2:D2}", h, m, s);
s = (int) m_objMediaPosition.CurrentPosition;
h = s / 3600;
m = (s  - (h * 3600)) / 60;
s = s - (h * 3600 + m * 60);
statusBarPanel3.Text = String.Format("{0:D2}:{1:D2}:{2:D2}", h, m, s);
}
else
{
statusBarPanel2.Text = "00:00:00";
statusBarPanel3.Text = "00:00:00";
}
}

When is the end of the file reached?

In order to determine, when the file was finished played, we overwrite the WndProc method, to intercept the EC_COMPLETE message, which sends DirectShow to the parent window, when the end of the file is reached.

Copy Code
ref Message m)
{
if (m.Msg == WM_GRAPHNOTIFY)
{
int lEventCode;
int lParam1, lParam2;
while (true)
{
try
{
m_objMediaEventEx.GetEvent(out lEventCode,
out lParam1,
out lParam2,
0);
m_objMediaEventEx.FreeEventParams(lEventCode, lParam1, lParam2);
if (lEventCode == EC_COMPLETE)
{
m_objMediaControl.Stop();
m_objMediaPosition.CurrentPosition = 0;
m_CurrentStatus = MediaStatus.Stopped;
UpdateStatusBar();
UpdateToolBar();
}
}
catch (Exception)
{
break;
}
}
}
base.WndProc(ref m);
}

History

  • 19.07.2002 - posted (first version)
  • 26.07.2002 - some changes in design and code

Links

Bugs and comments

If you have any comments or find some bugs, I would love to hear about it and make it better.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author


Member
Daniel Strigl is living in Austria, where he is studying Computer Science at the University of Innsbruck and working as a Software Developer at a Semiconductor Equipment Company. In his spare time he is working as a Rafting-Guide at the Outdoor Company wasser-c-raft and as a Ski- and Snowboard-Instructor at some local skischools.

His programming experience includes C/C++, C#, Java, Matlab, Assembler, MFC, DirectDraw, DirectShow, OpenGL, STL, .NET, .NET Compact Framework and a little bit HTML, JavaScript and PHP. He has worked on Microcontrollers, Texas Instruments Calculators, Texas Instruments DSPs, Pocket PCs and on PCs. His favorite development tools are Eclipse, Microsoft eMbedded Visual C++, Microsoft Visual Studio 2005, Keil uVision and Texas Instruments Code Composer Studio.

Occupation: Software Developer
Location: Austria

Other popular DirectX articles:

DirectShow MediaPlayer in C#
Article Top
Sign Up to vote for this article
Your reason for this vote:
DirectShow MediaPlayer in C#
You must Sign In to use this message board.
DirectShow MediaPlayer in C# FAQ  Noise Tolerance DirectShow MediaPlayer in C# Search Messages 
  Layout   Per page    
  Msgs 1 to 25 of 186 (Total in Forum: 186) (Refresh) FirstPrevNext
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Operations on playing video DirectShow MediaPlayer in C# anki123 0:21 3 Dec '08  
DirectShow MediaPlayer in C#
Hi

I want to perform some operations on playing video like Forward &
Rewind.
How can i do this?

Thanks
Sign In·View Thread·PermaLink
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Here is One FREE, RTSP DirectShow Source Filter with full source code DirectShow MediaPlayer in C# GUI Developer 5:52 26 Oct '08  
DirectShow MediaPlayer in C#
Hi,

There are several free for commercial use, published RTSP DirectShow Source Filters, with full source code in C++. i must admit that it took a LOT of searching to find them!

I will tell you about one that I think is the best. Look at the source code for VLC (VideoLAN) and pull out the files:

access.c
real.c
rtsp.c
rtsp.h

That's all you need.

Look at the sample Microsoft has for a source filter for DirectShow and add these files and compile and VIOLA! you have a DirectShow Source Filter that will play any RTSP stream !!!

It's easy to compile this in Visual Studio 6.0--it will compile in later versions of VisualStudio but you have to know what you are doing and you have to tweek the code.

This makes it easy to use DirectShow to play RTSP streams from ip cameras.

I am amazed that nobody has posted this code before.

Enjoy

www.SlickSkins.net GUI Guy

Sign In·View Thread·PermaLink 2.00/5 (1 vote)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# duration is not correct if playing a vbr mp3 DirectShow MediaPlayer in C# gl_media 1:02 24 Sep '08  
DirectShow MediaPlayer in C#
Hi,

it's great and helped me in getting started with directshow and c#. Thank you!

I recognized that if you are playing vbr (variable bitrate) mp3s, the duration is not correct.

It shows a longer time than the file can play. This makes it hard to do some action at a fixed time before the end of the audiofile. (I wanna do a crossfade to the next player instance 10 seconds before the file in the player ends).

Anyone solved this problem?

Thanks in advance!
Sign In·View Thread·PermaLink 1.00/5 (1 vote)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# compact framework DirectShow MediaPlayer in C# Member 2107386 21:36 20 Jun '08  
DirectShow MediaPlayer in C#
hey, can I use this code on compact framework for smart devices?!?
Sign In·View Thread·PermaLink 3.60/5 (4 votes)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Muliplt Sample Grabber DirectShow MediaPlayer in C# kazim bhai 6:40 11 Jun '08  
DirectShow MediaPlayer in C#
I am using Buffer CB function using two sample Grabber objects,
How may I know the buffer called is video or Audio as I want to process both of them while redering one file with both audio and Video.

Thanks in Advance

It is Kazim

Sign In·View Thread·PermaLink
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# how to control sound DirectShow MediaPlayer in C# Member 3531172 23:15 23 Apr '08  
DirectShow MediaPlayer in C#
hoow do i control sound in this application directshow
Sign In·View Thread·PermaLink 2.00/5 (2 votes)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Re: how to control sound DirectShow MediaPlayer in C# superbem 14:11 17 Jun '08  
DirectShow MediaPlayer in C#
That's a mute:

m_objBasicAudio = m_objFilterGraph as IBasicAudio;
try { m_objBasicAudio.Volume = -10000; }catch{}

That's max vol:

m_objBasicAudio = m_objFilterGraph as IBasicAudio;
try { m_objBasicAudio.Volume = 0; }catch{}
Sign In·View Thread·PermaLink 1.00/5 (1 vote)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Re: how to control sound DirectShow MediaPlayer in C# stu__pearce 13:12 9 Jul '08  
DirectShow MediaPlayer in C#
what if there are multiple audio tracks i.e. multiple sound renderers, how do i adjust individually ?
Sign In·View Thread·PermaLink
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# English hint DirectShow MediaPlayer in C# Sentonal 16:23 20 Mar '08  
DirectShow MediaPlayer in C#
"thanks for the help when improving my English knowledge spoke DirectShow MediaPlayer in C#. "

Should be written

"Thanks for any help in improving my written English."
OR
"Thank you in advance for helping me with my written English." (a bit more formal)
OR
"I would appricate any help in improving my English."

I didnt see anyone mentioning the grammer issues, so I figured I would mention them. Although your statement was understandable from a readability standpoint, it was not proper english.

GREAT ARTICLE!!!! Thank you for the article and for the tips, also for taking the time to show the technique to everyone. Your article helped me a great deal.
Sign In·View Thread·PermaLink
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Server side playlist, only the first video is played DirectShow MediaPlayer in C# buteskin 0:38 29 Nov '07  
DirectShow MediaPlayer in C#
When the content comes from a server side playlist, the Directshow method will only play the first video.

I tried to investige a bit, but it looks like it's not easy to fix. I think you need to send some http headers that come from the Microsoft streaming server.

So the best thing would be to use media player, but if anyone knows a (legal, not reversed engineered) way to play all videos from server side playlist, please let me know.

Bart

Sign In·View Thread·PermaLink 1.50/5 (2 votes)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# DirectShow as ASP.NET Web Application DirectShow MediaPlayer in C# menaka indr 14:43 19 Nov '07  
DirectShow MediaPlayer in C#
This example is what I want but not as Windows Forms instead I want to use it as ASP.NET Web Application.

Can someone please tell me how to do it or direct me to appropriate example where DirectShow is used as Web Application.

Thanks
Menaka
Sign In·View Thread·PermaLink 1.00/5 (2 votes)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# can it be run on windows mobiles ? DirectShow MediaPlayer in C# dinlo 18:25 16 Nov '07  
DirectShow MediaPlayer in C#
Great Job !!!DirectShow MediaPlayer in C#

I would like to ask what should be modified if it is run on windows mobile 5.

thanks !!
Sign In·View Thread·PermaLink 2.00/5 (1 vote)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Why It can not work on Window Server 2003! DirectShow MediaPlayer in C# doan0383 0:24 26 Oct '07  
DirectShow MediaPlayer in C#
At first thanks writter of the article.

I have question about :

- I use the lib to write a media program.
+ It work well on XP, Vista
+ but Window server 2003.

Could you give me an answer please?
Your help is very useful for me.

Thank you very much.

doan0383

Sign In·View Thread·PermaLink
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# IVideoWindow DirectShow MediaPlayer in C# Kamranit 20:43 24 Oct '07  
DirectShow MediaPlayer in C#
i m using IVideowindow which is class of Direct X but it working fine but i have three multimedia attached in one pc with the help of metrox card when i run my software on that machine it show only one multimedia please some one help me

Navaid Aijaz
Sign In·View Thread·PermaLink 1.00/5 (1 vote)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Two sound cards DirectShow MediaPlayer in C# Ibrahim Dwaikat 11:25 23 Oct '07  
DirectShow MediaPlayer in C#
At first, i will say: Good job


I have 2 sound card installed.. I need to choose sound card to output using it, in other words, i need to output not on the default output sound card... How can i do that???

Visit Me

www.engibrahim.tk

Sign In·View Thread·PermaLink 1.00/5 (1 vote)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Great job!!! DirectShow MediaPlayer in C# kapiltheripper 10:01 21 Aug '07  
DirectShow MediaPlayer in C#
hey man thanks for this nice article. DirectShow MediaPlayer in C#
Sign In·View Thread·PermaLink 2.00/5 (1 vote)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Normalize audio? DirectShow MediaPlayer in C# guden 23:24 14 Jul '07  
DirectShow MediaPlayer in C#
Hello,

First of all - GREAT EXAMPLE! - it was just what i needed to make a video/mp3 applicatoin for my media center... (party application).

But, do you know how i could posibly normalize the audio so that i wouldnt have to turn up and down on the volume of my speakers ?

Thanks in advance!
Best regards
-Simon Olesen, Denmark.
Sign In·View Thread·PermaLink 2.00/5 (4 votes)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# dear DirectShow MediaPlayer in C# Rabindra Patra 6:52 10 Jul '07  
DirectShow MediaPlayer in C#
dear,

I have used the sample application attached at
http://www.codeproject.com/cs/media/directshowmediaplayer.asp[^]

it is working fne but when am writting the same code in my application it is giving error. Like,

for the statement :
private IBasicAudio m_objBasicAudio = null;

null can not be converted to IBasicAudio because IBasicAudio is not a ref type and is a value type.

My basic need is to play any kind of movie, with desired aspect ratio.

please help

with best regards.

Rabindra Patra
Sign In·View Thread·PermaLink
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Does not support . mov files on MY computer DirectShow MediaPlayer in C# carlosj_z 20:52 25 May '07  
DirectShow MediaPlayer in C#
When I try to play a .mov file y throws and exception, it says THAT format is not supported, but I run this program on the computer of a friend and it works, I can play .mov files, and we both only have windows media player on our computers, any suggestion to solve my problem?DirectShow MediaPlayer in C#

cjzs
Sign In·View Thread·PermaLink 2.00/5 (1 vote)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Re: Does not support . mov files on MY computer DirectShow MediaPlayer in C# Daniel Strigl 21:38 25 May '07  
DirectShow MediaPlayer in C#
Maybe your friend has installed a correct DirectShow filter to read mov (QuickTime) movies.

Just install the QuickTime Alternative from http://www.free-codecs.com/download/QuickTime_Alternative.htm and it should work!

Features of QuickTime Alternative 1.81:
...
- QuickTime DirectShow filter: allows you to play QuickTime content in all DirectShow enabled players.
Without this filter QuickTime content can only be played in Media Player Classic.
...

Regards,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE. DirectShow MediaPlayer in C#

Sign In·View Thread·PermaLink 4.00/5 (1 vote)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# thanks for your codes DirectShow MediaPlayer in C# pengli0723 16:52 5 Apr '07  
DirectShow MediaPlayer in C#
it really helps me a lot, thanks!
Sign In·View Thread·PermaLink
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Re: thanks for your codes DirectShow MediaPlayer in C# gajendra kumar bansal 23:19 16 Feb '09  
DirectShow MediaPlayer in C#
<small> DirectShow MediaPlayer in C# </small>this site is really very goods
                        thanks<pre><code> DirectShow MediaPlayer in C#   DirectShow MediaPlayer in C# </code></pre>
Sign In·View Thread·PermaLink
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# Re: thanks for your codes DirectShow MediaPlayer in C# Todd Chen 22:04 14 Apr '09  
DirectShow MediaPlayer in C#
I am trying to use DirectShow in C#, this article is really clear and very helpful to me, thanks!

Todd Chen

My Blog: No Geek Here! - A blog about DirectShow, Network, and Windows Programming Techniques[^]
Sign In·View Thread·PermaLink
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# How can I give a byte array as input to a filter graph in DirectShow ? DirectShow MediaPlayer in C# sidsidz 23:36 29 Mar '07  
DirectShow MediaPlayer in C#
I am getting an MPEG video stream which I am saving in a byte array. I have to decode this stream. After some research, I have decided to do this in DirectShow. I am working in C#.

Now the problem:
How do I provide this byte array stream to the filter graph ?
Should I use the Source Filter?
Or will I have to obtain that byte array as an object in COM?

I am using DirectShow for the first time. I would be really grateful if I could get a reply soon as I am working on a project and time is short. Tell me if I am not clear in my description of my problem. I'll try to explain more.

_____________________________________________________________
Trying to make sense of it all ...
Sign In·View Thread·PermaLink 3.69/5 (10 votes)
DirectShow MediaPlayer in C#
DirectShow MediaPlayer in C# multiple videocard rendering DirectShow MediaPlayer in C# wjp 22:59 28 Feb '07  
DirectShow MediaPlayer in C#
Dear programmers,

At the time i'm working on a little project which should give me the possibility to show a mpeg or such, or a captured webcam stream onto multiple screens. Currently i'm working on laptop using the extra videocard for extended desktop. The app i'm building shows a picture or a flashmovie on both the screen simultaniously, when i start a movie, using this example the second video card only displays a black picturebox. No movie is displayed on it. Can someone explane me how to accomplish this.
Be carefull with me, i'm very new to directX. For me its magic when just the movie appears in the picturebox.



Bernadette
Sign In·View Thread·PermaLink
DirectShow MediaPlayer in C#

DirectShow MediaPlayer in C# General    DirectShow MediaPlayer in C# News    DirectShow MediaPlayer in C# Question    DirectShow MediaPlayer in C# Answer    DirectShow MediaPlayer in C# Joke    DirectShow MediaPlayer in C# Rant    DirectShow MediaPlayer in C# Admin   

相关文章: