Decoding H.264 with NVidia PureVideo or PureVideo2


  •   Hi, I'm looking for advice on how to use my hardware accelerator to read/decode H.264 streams in .m2ts format using Media Foundation. I have a GeForce 9800GX2 and it has PureVideo2 acceleration on-board. My application needs to read sequential frames and does not render to screen. Since the MSDN help files on DXVA deal exclusively with the case where you'd like to implement an IMFTransform, I'm looking for guidance on how to read sequential frames. Since this is a common use case, I figured that others would also benefit from the thread.


    Can someone briefly outline the process for doing this, or point me to resources/sample code online that will get me going?





    Friday, October 17, 2008 1:08 AM


  • A couple complications with this:

    - There is no MPEG2 source in MF, so if you want to handle .m2ts files you would need to write the media source yourself.

    - DXVA is not a great thing to be using if you are not trying to render the frames.  Reading the frames back from video memory is a very expensive operation, and you often lose whatever benefit you gained from hardware acceleration and then some.

    If you are okay with your app only being able to run on Win7+, your best option for reading frames is the Source Reader.  See the 'Hardware Acceleration' section for information on setting up DXVA in the source reader using the MF_SOURCE_READER_D3D_MANAGER attribute, but note that this might not be a good idea as outline above.
    Sunday, December 06, 2009 6:49 AM