unosquare / ffmediaelement

FFME: The Advanced WPF MediaElement (based on FFmpeg)
https://unosquare.github.io/ffmediaelement/
Other
1.17k stars 240 forks source link

Question: Grab raw decoded frames rather than format coverted Bgra frames #520

Closed joedemax closed 3 years ago

joedemax commented 4 years ago

Hi

Great library. In my application sometiems I need to process frames on the GPU. I see the RenderingVideo event which provides a Bitmap, which always seems to be Bgra32, where as the stream is YUV420. I would like to grab the frames as YUV420 for GPU upload, thus saving memory bandwidth. Is this possible?

Best,

Joe de Max

mariodivece commented 3 years ago

This is outside the scope of this project and you should be able to find lengthy discussions on integrating WPF with GPU surfaces (search issues in this project). I have attempted to implement a direct link from a GPU surface to the WPF display system multiple times and so far I have been unable to do so. You could start exploring VideoComponent.cs Search for calls to HardwareAccelerator.ExchangeFrame and MaterializeFrame

Let me know if you get anywhere...