DirectShow,媒体基金会,DXVA,什么? [英] DirectShow, Media Foundation, DXVA, what?

查看:158
本文介绍了DirectShow,媒体基金会,DXVA,什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的任务是修改使用DirectShow进行视频渲染的应用程序.旧的应用程序可以正常运行,但是开始显示年龄.

I'm tasked with revising an application which uses DirectShow for video rendering. The old application works fine, but it's starting to show age.

由于我具有游戏背景,因此我认为应该采用这种方式.使用不同的技术制作了一堆原型之后,我非常确定我可以提取视频到纹理的渲染,并使用DirectX满足所有客户的要求.

As I have a gaming background, I figured I should just approach this as such. After having made a bunch of prototypes using different techniques, I was pretty sure I could pull of video-to-texture rendering and use DirectX to fulfill all the clients his requests.

但是,现在我必须选择一种技巧,我再也不会迷路了……

However, I'm now at the point I have to pick a technique to go with and I couldn't be more lost...

  • DirectShow
  • 媒体基金会
    • 媒体会话(< Windows 8)
    • 媒体引擎(> Windows 8)

    DirectShow显然是最老的,但仍然可以很好地工作,这主要是因为可用的编解码器数量巨大.

    DirectShow is obviously the oldest, but still works pretty well, also mostly because of the HUGE amount of codecs available.

    Media Foundation已随Windows Vista一起引入,直到Windows 8都具有称为"Media Session"的名称,此后,他们又引入了"Media Engine".我是否正确将编解码器称为MFT?确实有像free-codecs.com这样的网站可用吗?

    Media Foundation has been introduced with Windows Vista, and had something called "Media Session" up til Windows 8, after which they introduced the "Media Engine". If I'm correct codecs are called MFTs? Are there actually sites that have these available much like free-codecs.com?

    在这两种技术之上,还有DXVA,它使您可以将视频解码卸载到GPU.目前,我遇到了3种不同的类型.DXVA1是XP以来的一种实现方式,DXVA2是更新的API.但是DXVA-HD是什么?它比DXVA2更新还是同名?

    On top of these 2 techniques, there is DXVA, which allows you to offload video decoding to the GPU. Currently, I ran into 3 different types. DXVA1 being an implementation that has been around since XP, DXVA2 being the newer API. But what is DXVA-HD? Is it newer than DXVA2 or is it an equivalent name?

    我真的很想转向Media Foundation,开箱即用的编解码器可以很好地与客户想要使用的格式配合使用.我所关心的只是获得编解码器的难易程度... Windows 8+默认媒体播放器是否仍然同时具有DirectShow和MF渲染路径并即时交换它们,还是Microsoft完全淘汰了DirectShow?

    I really want to move towards Media Foundation, the out-of-the-box codecs work really well with the formats the client wants to use. All I'm concerned is how easy it is to get codecs for it... Does Windows 8+ default media player still have both DirectShow and MF render paths and swaps them on the fly or is Microsoft completely phasing out DirectShow?

    我也不太了解DXVA应该如何工作.鉴于我基本上想在游戏内渲染视频,只有使所有渲染实际上都发生在GPU上并将应用程序逻辑保留在CPU上才有意义,但是我真的找不到关于如何使用Media来利用视频的好例子.基础.这主要是由于我不知道DXVA2和DXVA-HD之间的区别所致.Windows 7 SDK随附了所有3种实现的示例...

    I also can't quite grasp how DXVA is supposed to work. Given I want to basically render videos inside a game, it would only make sense to make all rendering actually happen on the GPU and keep application logic on the CPU, but I can't really find any good examples on how to utilize it using Media Foundation. This is mostly caused by the fact I don't know the difference between DXVA2 and DXVA-HD. Windows 7 SDK came with samples for all 3 implementations...

    如果有人可以粗体回答我的问题,纠正我的错误信息并指出正确的示例(DirectX + Media Foundation + DXVA-无论如何)的方向,我将不胜感激!它可能很简单,例如将Windows 7 SDK的这3个示例结合起来以获取所需的内容.

    If someone could answer my questions in bold, correct my misinformation and point me in the direction of a proper example(s) (DirectX + Media Foundation + DXVA-whatever), I would be really grateful! It could be as simple as "combine these 3 examples of the Windows 7 SDK to get what you want).

    整个任务的目标是再次以一流的形式获得该应用程序,我绝对要确保我选择了将持续到下一个十年的技术,例如DirectShow已经具备的技术:P

    The target of the whole assignment is to get the application in top-notch form again and I want to absolutely sure I pick the techniques that will last for the next decade like DirectShow already has :P

    推荐答案

    如果我正确的编解码器称为MFT?其实有没有像free-codecs.com这样的网站可用?

    If I'm correct codecs are called MFTs? Are there actually sites that have these available much like free-codecs.com?

    编解码器通常是从压缩格式解压缩为未压缩(解码器)或反之亦然(编码器)的软件项目.这两个API均未使用精确的编解码器进行操作,而是为具有输入和输出(例如,输入输出)的组件定义了通用接口.DirectShow,DirectX媒体对象(DMO)或其演变-媒体基础转换(MFT)中进行过滤.

    Codecs are typically software items whcih either decompress from compressed format to uncompressed (decoders) or vice versa (encoders). Neither of the APIs operate with exactly codecs and instead define a general interface for a component with input and output, e.g. filter in DirectShow, DirectX Media Object (DMO), or its evolution - Media Foundnation Transform (MFT).

    MFT是Media Foundation的基本组件:编码器,解码器,效果器,缩放器,视频捕获设备-都内置MFT,并在此之上构建了更高级别的API.

    MFT is a base component of Media Foundation: encoders, decoders, effects, scalers, video capture devices - all have MFTs inside and higher level API is built on top of that.

    由于对Media Foundation的兴趣有限,所以第三方MFT很少见.尽管您几乎可以在DirectShow过滤器外形中找到任何东西,但Media Foundation和MFT却并非如此.

    Due to limited interest in Media Foundation overall third party MFTs are a rare thing. While you can find almost anything in DirectShow filter form factor, it is not the case with Media Foundation and MFTs.

    但是DXVA-HD是什么?它比DXVA2更新还是同名?

    But what is DXVA-HD? Is it newer than DXVA2 or is it an equivalent name?

    DXVA-HD是DXVA 2.0 API系列的一部分,涵盖了硬件加速的视频处理.作为公共低级界面提供,它也集成在DirectShow和Media Foundation库存组件中.

    DXVA-HD is a part of DXVA 2.0 family of APIs and covers hardware-accelerated video processing. Available as public low level interface, it is also integrated in DirectShow and Media Foundation stock components.

    Windows 8+默认媒体播放器是否仍然具有DirectShow和MF渲染路径并即时交换它们,还是Microsoft完全淘汰了DirectShow?

    Does Windows 8+ default media player still have both DirectShow and MF render paths and swaps them on the fly or is Microsoft completely phasing out DirectShow?

    是的,WMP 12仍然兼有.Windows 10电影和电视电视播放器仅适用于MF.

    Yes, WMP 12 still has both. Windows 10 Movies & TV player is MF only.

    鉴于我想基本上在游戏内渲染视频,只有使所有渲染实际上发生在GPU上并将应用程序逻辑保留在CPU上才有意义,但是我真的找不到关于如何利用视频的很好的例子它使用Media Foundation.

    Given I want to basically render videos inside a game, it would only make sense to make all rendering actually happen on the GPU and keep application logic on the CPU, but I can't really find any good examples on how to utilize it using Media Foundation.

    DirectShow和Media Foundation均提供具有DXVA支持的常规解码器(主要用于H.264,但不仅限于此).我想说DirectShow的实现相当不灵活,并且打算与EVR一起使用.Media Foundation的实现更加灵活,可以作为MFT在MF管道之外使用.但是,两者都隐藏了所有复杂性,并在幕后自动利用DXVA解码.

    Both DirectShow and Media Foundation offer stock decoders with DXVA support (primarily for H.264 but not only). I would say that DirectShow implementation is rather inflexible and intended for use with EVR. Media Foundation's is more flexibly implemented and can be used outside of MF pipeline as an MFT. Both however are made to hide all complexity and utilize DXVA decoding automatically behind the scenes.

    ...而且我想绝对确定我会选择DirectShow已经拥有的,将在未来十年持续使用的技术

    ... and I want to absolutely sure I pick the techniques that will last for the next decade like DirectShow already has

    DirectShow仍然是旧版API,在示例,代码,公共信息,文档,第三方可扩展性方面提供了更多慷慨的功能.Media Foundation是一个预期的替代品,引起了人们的极大兴趣.基本上,与DirectShow相比,它提供的功能不多,Microsoft并未开发它来覆盖DirectShow的功能集-较新的API经常会提供这种功能,但不提供有用的开发人员工具.似乎应该认为MF是一种较新的产品,应自行出售,但最终效果不佳:

    DirectShow is still here as a legacy API, with much more generous offering in samples, code, public information, documentation, third party extensibility. Media Foundation is an intended replacement drawing very limited interest to it. Basically it does not offer much compared to DirectShow, Microsoft did not develop it to cover the feature set of DirectShow - what is often expected from newer API, does not offer useful developer tools. It looks like it was supposed that MF's being a newer thing should sell it on its own, but eventually it did not work out:

    [...]

    但是请记住,即使在7年前,DirectShow也已经15岁了.基类从一开始就以源代码形式发布.他们已经受到关心的程序员超过20年的关注.问题早已解决.

    But remember, even 7 years ago, DirectShow was already 15 years old. The baseclasses were released in source form from the start. They've had more than 2 decades of attention paid by programmers who care. The problems were ironed out a long time ago.

    [...]

    现在,说了这么多,确实雷德蒙德的人们认为DirectShow是一种过时的技术.他们之所以移居到媒体基金会,是出于完全使我逃脱的原因.我有一个找到媒体基金会比DirectShow更好解决的问题.它固有的局限性意味着存在一些根本无法解决的问题.我永远不会理解他们为什么选择重新开始,而不是修补DShow中他们不喜欢的内容.尽管词汇不同,但基本概念完全相同.只是浪费资源.

    Now, having said all that, it's true that the folks in Redmond consider DirectShow to be a dead technology. They've moved on to Media Foundation, for reasons that utterly escape me. I have YET to find a problem that Media Foundation solves better than DirectShow. Its inherent limitations mean that there are problems it simply cannot solve. I will never understand why they chose to start over, instead of patching whatever they didn't like in DShow. The fundamental concepts are absolutely identical, although the vocabulary is different. It's just a waste of resources.

    2019年7月更新

    我想链接

    July 2019 Update

    I would like to link a comment from Microsoft's James Dailey regarding on DirectShow related issue, and it also neatly outlines the status of DirectShow overall as of 2019:

    请记住,尽管DirectShow在技术上仍受支持,但我们正在淘汰此旧技术.我们要求您尽快移至MediaFoundation.

    Please keep in mind that while DirectShow is technically still supported we are in the process of deprecating this legacy technology. We ask that you please move to MediaFoundation as soon as possible.

    这篇关于DirectShow,媒体基金会,DXVA,什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆