XNA Game Studio: I could play video but I'd rather not

by Miha Markič 9. October 2008 16:00

Did you ever try to play a video inside your DirectX application, or a newer XNA Game Studio? One could assume that this is a trivial task, right? WPF lets you play it, heck, even Silverlight has no problems playing video - it is a matter of setting a bunch of properties on a proper object and voila.

So, XNA (same goes for DirectX) shouldn't have problem playing videos, too. WRONG. Playing video in XNA is a tricky, difficult and  you don't know when you'll get an unmanaged exception. Every solution out there I saw is based on DirectShow COM thing (luckily, there is a .net wrapper for DirectShow at http://directshownet.sourceforge.net/) like i.e. XNA DirectShow Video Player. But don't think this is an excellent solution. Dealing with video is still very problematic - while I haven't yet tried the mentioned video player I tried some other similar solutions and none of them is rock solid.

The logical question would be: why doesn't [MS] support video playback in XNA natively (through whatever library as long as one doesn't have to deal with low level details)? Or better, playing video to texture would be more than enough. Didn't they think of it? Sure they did, there is even a very highly rated request at Connect. It is dated back to year 2006! After a week or two it has been marked as Closed - Postponed. That's it.

This issue begs for two questions:

  1. Is it really that difficult to add video to texture playback in XNA/DirectX?
  2. Why bother giving feedback to Connect at all?

I/We are not asking for some obscure feature after all. Having the video manipulation ability opens many interesting possibilities. Interestingly, video to texture playback was introduced with first versions of Managed DirectX library and soon after discarded, I guess because of bugs.

What gives? I guess we'll have to deal with that DirectShow directly in one way or another for a long time to come. Or pay a huge price to a 3rd party. Is there a third solution I am not aware of?

UPDATE [19.10.2008]: I just found Scurvy Media project on CodePlex that does play a subset of AVI video -> texture without messing with DirectShow. It looks quite promising. Perhaps the biggest drawback is lack of audio playback (not sure about this, looks like is roadmapped to next release).

Tags:

.net

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Miha Markic

About me
Righthand
 
Microsoft MVP
 
Developer Express' DXSquad
INETA Country Leader for Slovenia
INETA Country Leader for Slovenia

Slovene Developer Users Group Lead
Friends of Red-Gate
LLBLGenPro Partner

Miha currently works as a free lance consultant and software developer specialized in .net area.
He graduated in Computer and information science at the University of Ljubljana, Slovenia. He has accumulated experience in various programming languages such as Java, Visual Basic 3-6 (MCP), Visual C++, Delphi, C# and VB.Net through years.
He has experience in practically all (technical) stages of project development, including planning, framework development, user interface, business processes, as well as testing and documenting. He has worked on big and small projects in Slovenia and abroad (e.g. participated in completing level 3 IS for the Nucor steel plant, Hertford, USA).
Currently he enjoys programming in .net environment using C#. Since 2000 he has been active in Developer Express' DX Squad and has been ECDL trainer and tester. He also gives lectures on conferences and other events in Slovenia.

Month List

Tag cloud

Most comments

Paulius Paulius
1 comments
us United States
Meh Meh
1 comments
us United States
bart dm bart dm
1 comments
nl Netherlands

RecentComments

Comment RSS