Ejemplo n.º 1
0
        public static void createHeadHidedMovie(List <MyColorFrame> colorframes, List <MySkeletonFrame> skeletonframes, string path)
        {
            int width    = 640;
            int height   = 480;
            var framRate = 30;

            // create instance of video writer
            using (var vFWriter = new VideoFileWriter())
            {
                // create new video file
                vFWriter.Open(path, width, height, framRate, VideoCodec.MPEG4, 2000000);

                for (int i = 0; i < colorframes.Count; i++)
                {
                    if (skeletonframes.Count > i)
                    {
                        MyOverlayFrame        ovframe         = new MyOverlayFrame(skeletonframes.ElementAt(i), colorframes.ElementAt(i));
                        MemoryStream          frame_memstream = ovframe.getHeadHidedMemoryStream();
                        System.Drawing.Bitmap imageEntity     = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(frame_memstream);
                        vFWriter.WriteVideoFrame(imageEntity);
                    }
                }
                vFWriter.Close();
            }
        }
Ejemplo n.º 2
0
        private void load_overlay(MyOverlayFrame frame)
        {
            timeTagLabel.Content = frame.getTime().ToString();
            System.IO.MemoryStream ms = frame.getOverlayMemoryStream();
            ms.Position = 0;
            ImageSourceConverter c  = new ImageSourceConverter();
            BitmapImage          bi = new BitmapImage();

            bi.BeginInit();
            bi.StreamSource = ms;
            bi.EndInit();
            currentFrame.Source = bi;
        }