Frame loss for above FullHD resolution .Is AVI Dec

2019-05-13 00:43发布

问题:

I'm developing a multimedia streaming application for Desktop using SourceReader MediaFoundation technique.

I'm using USB camera device to show streaming. The camera supports 2-video formats: YUY2 and MJPG.

For 1980x1080p YUY2 video resolution, receiving only 48fps for 60fps. I fetched YUY2-RGB32 conversion from MSDN page and using in my application (Note: I didn't use any transform filter for color conversion).

For MJPG video format, I used MJPEG Decoder MFT to convert MJPG - YUY2 - RGB32 and then displaying on the window using Direct3D9. For specific resolution, I'm facing framerate drops from 60fps to 30fps(Ex: 1920x1080 60fps but drawing only 30-33fps).

Two ways, I verified in Graphedit to confirm about the filter:

  1. Added MJPEG Decompressor filter and built the graph for MJPG video format to check fps for FullHD resolution and its showing 28fps for 60fps.

  2. Added AVI Decompressor filter and built the graph for MJPG video format to check fps for FullHD resolution and its showing 60fps.

I have searched on many sites to find AVI decompressor for media foundation but no luck.

Anyone confirm, is there any filter available in MFT?

回答1:

Microsoft ships [recent versions of] Windows with stock Motion JPEG decoders:

  • MJPEG Decompressor Filter for DirectShow
  • MJPEG Decoder MFT for Media Foundation

To my best knowledge those do not share codebases, however both are not supposed to be performance efficient decoders.

Your using GraphEdit means you are trying DirectShow decoders and AVI Decompressor is supposedly using another (Video for Windows) codec which you did not identify.

For Media Foundation, you might be able to use Intel Hardware M-JPEG Decoder MFT or NVIDIA MJPEG Video Decoder MFT is you have respective hardware and drivers. Presumably, vendor specific decoders deliver better performance, and also have higher priority compared to generic software peers. Other than this, for an MFT form factor you might need to look at commercial decoders and/or custom developed, as the API itself is not so much popular to offer a wide range of options.