This project has moved. For the latest updates, please go here.

What is the most efficient way to implement recording / playback video in Win8 / WinRT / C#?

Jan 14, 2013 at 6:43 AM

Hello,

I would like to have the functionality to record and playback video. 

In your test application you have:

       private async void mjpeg_FrameReady( object sender, FrameReadyEventArgs e )
            {
            InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream();
            await stream.WriteAsync( e.FrameBuffer );
            stream.Seek( 0 );
            _bmp.SetSource( stream );
            image.Source = _bmp;
            }

Would that be the place to save the data and replay it?

Thanks,
Eitan Barazani

Coordinator
Jan 14, 2013 at 6:25 PM

That event is where you will receive each individual JPEG frame.  It's up to you what you do with them...display, save, encode to another format, etc.  There isn't an automatic way to turn this into a supported video format, so you'd need to write an encoder of some variety.

Jan 14, 2013 at 7:17 PM
Hi Brian,
I thought to store the frames into a file. Then, in replay, to read and display them into the image control one frame at a time with a delay equal to the time the frames were obtained from the camera (so it will show almost as the real thing).
Thanks,
Eitan
Sent from Windows Mail
From: peekb
Sent: ‎January‎ ‎14‎, ‎2013 ‎10‎:‎25‎ ‎AM
To: eitanbarazani@hotmail.com
Subject: Re: What is the most efficient way to implement recording / playback video in Win8 / WinRT / C#? [mjpeg:429496]

From: peekb

That event is where you will receive each individual JPEG frame. It's up to you what you do with them...display, save, encode to another format, etc. There isn't an automatic way to turn this into a supported video format, so you'd need to write an encoder of some variety.

Coordinator
Jan 14, 2013 at 7:24 PM

That should work.  Note that MJPEG is a pretty data-heavy protocol, so that data capture might grow pretty quickly.

Jan 14, 2013 at 7:28 PM
That is one of my concerns, that storing into file might take a lot of space (on RT machine might be an issue). I have to try it to get some feel for it.
Eitan
Sent from Windows Mail
From: peekb
Sent: ‎January‎ ‎14‎, ‎2013 ‎11‎:‎24‎ ‎AM
To: eitanbarazani@hotmail.com
Subject: Re: What is the most efficient way to implement recording / playback video in Win8 / WinRT / C#? [mjpeg:429496]

From: peekb

That should work. Note that MJPEG is a pretty data-heavy protocol, so that data capture might grow pretty quickly.