locked
Enable recording with hardware acceleration for MediaCapture

    Question

  • Hey guys,

    There is hardwareAccelerationEnabled property for MediaTranscoder to turn on hardware acceleration.

    But I cannot find similar property to turn on hardware encoding for startRecordToStorageFileAsync.

    After googling, I found MF_TOPOLOGY_HARDWARE_MODE attribute might help.

    But calling getEncoderProperty with it throws an exception.

    I'm currently trying to accelerate MP4 encoding, because in some platforms, the output 1080p video has a very low frame rate(less than 10).

    Comparatively, the built-in Camera app can output 1080p video with up to 22 fps.

    Could anyone tell me how?

    A thousand thanks.

    Update:

    I found that the issue happens if my app adds a custom MFT using addEffectAsync.

    • Edited by noobrocks Tuesday, August 28, 2012 7:27 AM
    Monday, August 27, 2012 4:03 PM

Answers

  • Hello,

    Hardware acceleration (HWA) is always enabled if possible. Adding additional custom MFTs that are not HWA aware can upset the balance of the topology and cause HWA to be negated or not fully utilized.

    I hope this helps,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, August 29, 2012 9:28 PM
    Moderator

All replies

  • Hi Noo,

    Removing the customer MFT fixed your issue then?

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, August 28, 2012 12:31 PM
    Moderator
  • Hi Jeff,

    Removing the custom MFT does make the output frame rate much better.

    To find out the root cause,

    I wonder if hardware acceleration is definitely enabled regardless of the MFTs added.

    I don't know whether hardware acceleration is disabled because of the added MFT or

    the low frame rate arises from the added MFT.

    Tuesday, August 28, 2012 12:56 PM
  • Hello,

    Hardware acceleration (HWA) is always enabled if possible. Adding additional custom MFTs that are not HWA aware can upset the balance of the topology and cause HWA to be negated or not fully utilized.

    I hope this helps,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, August 29, 2012 9:28 PM
    Moderator
  • James,

    Are there any guidelines for MFTs so that they don't upset the HWA?

    Thursday, August 30, 2012 12:47 AM
  • Create a D3D / DXVA aware MFT.

    Direct3D-Aware MFTs

    http://msdn.microsoft.com/en-us/library/windows/desktop/ee663585(v=vs.85).aspx

    Supporting DXVA 2.0 in Media Foundation

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa965266(v=vs.85).aspx

    -James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Saturday, September 01, 2012 12:06 AM
    Moderator