I am trying to play a stream of bitmap images using openCVSharp to generate the Bitmaps from YUV. But I am unable to display it as a video.
I found some links regarding using it as an AVI wrapper here and some more to save on the hard disk like here and FFMPEG might work great on LINUX, but it is not so good in Windows.
I even tried with by using the following code. But it just displays the last frame in the sequence, and I do not have a URI for using MediaElement as the bitmaps are generated by my program.
image.source = ToBitmapSource(bitmapImage);
where
public static BitmapSource ToBitmapSource(System.Drawing.Bitmap bitmap){
IntPtr ip = bitmap.GetHbitmap();
BitmapSource bs = null;
bs = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(ip,
IntPtr.Zero, System.Windows.Int32Rect.Empty,
System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
return bs;
}
I am trying to play the video (similar to streaming) without saving it on the computer. Is direct show a must for this? I desperately need your help, my deadline is fast approaching!