Question: How to set YUV420p byte array as a source for MediaPlayerElement in WinUI3 #8654
Replies: 3 comments
-
You need to use a MediaStreamSource. You can check out https://github.com/ffmpeginteropx/FFmpegInteropX if you want an advanced implementation. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
On the other repo you mentioned WPF, here your app seems to be winUI. The reason why you can't pass YUV directly to the MediaSource is that windows doesn't decode YUV directly, it needs a converter. This is why you need a MediaStreamSource (not a MediaSource - I know, pretty confusing naming). |
Beta Was this translation helpful? Give feedback.
-
I have byte arrays for a video stream in YUV420p format. I want to set this as the source for MediaPlayerElement to play the video in WinUI3 application. What is the best (and fastest) way to do this?
Note: I do NOT want to save it in a file since it is a real-time video to be rendered inside the app and we want to avoid any unnecessary memory/time consumption
I came across MediaElement as well, but the only solutions I found included reading the data from a file (which we want to avoid since it is a real-time video feed) unlike Silverlight. Also, I am not sure if MediaElement is actually supported in WinUI3
Beta Was this translation helpful? Give feedback.
All reactions