简体   繁体   English

C#DirectX音频/视频播放“ VFW_E_UNSUPPORTED_STREAM”

[英]C# DirectX Audio/Video Playback “VFW_E_UNSUPPORTED_STREAM”

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){...} . 我正在尝试使用DirectX为MP4创建视频播放器,并且该视频播放器可以在我的计算机上运行,​​但是我在上网本上尝试了我的应用程序,并且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. 感谢您提供的任何帮助。

VFW_E_UNSUPPORTED_STREAM is an error code returned by underlying DirectShow layer , which indicates that it was unable to build playback pipeline. VFW_E_UNSUPPORTED_STREAM基础DirectShow层返回的错误代码,表明它无法建立回放管道。 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). 正如您提到的MP4一样,您可能需要安装第三方过滤器/编解码器,因为现有的 Windows在DirectShow API中没有为此提供组件( GDCL过滤器应在Windows 7+和更高版本的系统中解决此问题,通常也需要第三方H .264解码器)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM