For my wpf application i need to play video files saved in a MemoryStream. Is it possibile to achieve this by using WPF-mediakit?
Since MediaElement does not support playing a video directly from memory I have been using the vlc.dotnet library to achieve this. However I am looking for an alternative. I have found some posts that say WPF-Mediakit can play videos from a MemoryStream, but i was unable to find the described functionality in the source code or documentation.
If anyone could point me in the right direction towards playing video saved in memory in WPF-Mediakit, that would be great.
No, WPF-MediaKit cannot play video from memory stream. Just save it to a temporary file (e.g. use
System.IO.Path.GetTempFileName()) and play the video from file.WPF-MediaKit uses DirectShowLib, which is just a wrapper around MS Windows DirectShow interface. And that is unmanaged code. So:
MemoryStream, i.e. managed memory, for an unmanaged code. You have to use unmanaged memory.Note: You may also some FFmpeg based solutions, see https://github.com/Sascha-L/WPF-MediaKit/wiki/Similar-Projects e.g. FFME.