C# DirectX Audio/Video Playback "VFW_E_UNSUPPORTED_STREAM"

3k Views Asked by At

I am trying to create a video player for MP4's with DirectX and it works on my computer but I tried my application on a netbook and this error code pops up in a try{...}catch(Exception e){...}.

Error in the application.
-2147220891 (VFW_E_UNSUPPORTED_STREAM)
   at Microsoft.DirectX.AudioVideoPlayback.Video.Open(String fileName, Boolean autoRun)
   at Microsoft.DirectX.AudioVideoPlayback.Video..ctor(String fileName, Boolean autoRun)
   at Video_Player.Player.PeekWind_Load(Object sender, EventArgs e)

This is some of my code.

Microsoft.DirectX.AudioVideoPlayback.Video video = new Microsoft.DirectX.AudioVideoPlayback.Video("C:\TestVideo.mp4", true);
video.Owner = ViewPane;
video.Size = new Size(Video.DefaultSize.Width, Video.DefaultSize.Height);
video.Audio.Volume = -2500;
video.Play();

Thank you for any help given.

1

There are 1 best solutions below

6
On BEST ANSWER

VFW_E_UNSUPPORTED_STREAM is an error code returned by underlying DirectShow layer, which indicates that it was unable to build playback pipeline. Which in turn means that some stream or format whatsoever could not be recognized and is typically missing a codec/filter component to read the data into decoded and presentation-ready state.

As you mention MP4, you presumably need a third party filter/codec installed since stock Windows does not offer a component for this within DirectShow API (GDCL filters should fix this in Windows 7+ and in older systems you also typically need a third party H.264 decoder in addition).