媒体基础:在没有容器的情况下解码和显示 H264 帧
场景是这样的:我的 Windows 客户端应用程序以自定义方式(专有协议)从网络源获取 H264 编码的帧,无需容器。帧的格式是已知的。我需要解码帧并显示视频。要求在高清流媒体时能够完美播放,但在其他场景下可以选择低延迟。
目前,我使用 ffmpeg 的 libavcodec 来解码帧,然后使用 StretchBlt 手动将它们显示在屏幕上。我们正在考虑迁移到媒体基金会,但我不清楚 - 是否有可能拥有不使用容器的源?如果是这样,我需要创建一个自定义的吗?
也欢迎使用媒体基础的替代方案。我目前使用的方法的主要问题是性能不够好,特别是对于高清视频。
The scenario is this: My Windows client app gets H264-encoded frames from a network source, without a container, in a custom way (proprietary protocol). The format of the frames is known. I need to decode the frames and display the video. It is required that the playback will be flawless during HD streaming, but have an option for low-latency for other scenarios.
Currently, I use ffmpeg's libavcodec to decode the frames, then manually display them on the screen with StretchBlt. We're considering a move to Media Foundation, but it's not clear to me - is it possible to have a source that does not use a container? if so, do I need to create a custom one?
Alternatives to using Media Foundation are also welcome. My main issue with the method that I currently use is that the performance is not good enough, especially for HD video.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有看到您提到您特别需要或什么
Media Foundation
API,因此我建议使用DirectShow
,您可以使用它来实现:I don't see you mention that you specifically need or what
Media Foundation
API, so I would suggestDirectShow
, which you can do it with: