Here its stated that I can record video using AudioVideoCaptureDevice
but there is no sample or help provided.
I need to do the following things:
- record the video into a stream DONE
- display a thumbnail of video recorded (can be a frame captured while video recording) DONE
- replay the video recorded DONE
- change resolution and type of camera (front/back) DONE
How to achieve this? Are there any samples? I am unable to find them. Please help me.
DONE
- record the video into a stream
- replay the video recorded
- change resolution and type of camera (front/back)
- display a thumbnail of video recorded (can be a frame captured while video recording)
NEW PROBLEMS
- front camera video is mirror inverted. I am able to change this while recording using transform but the actual video is still mirrored.
UPDATE
- calculate the size of the recording video and display it. Its not working. Stream.Size is giving random values.
Any thoughts on solving these?
The basics of using the Windows Phone 8 camera are covered here...
Advanced photo capture for Windows Phone 8
How to save a picture captured with the new camera’s API in the camera roll in Windows Phone 8
How to set video record resolution in Windows Phone 8
How to set advanced properties for video recording in WP8
Note: there are issues when getting the supported resolutions of the front camera on some Lumia devices
For the problem of Displaying a Thumbnail of the video recording...there is an event called PreviewFrameAvailable on the AudioVideoCaptureDevice. I think if you setup this event handler it will tell you when the data is available to get a preview (image/thumbnail) of the video.
There are also 3 methods for grabbing a byte array of a preview image (GetPreviewBufferARGB, GetPreviewBufferY, GetPreviewBufferYCbCr). All three of these methods return a byte[] of the pixel data for the image in the corresponding format (ex: GetPreviewBufferARGB should return the raw bytes of a raw bitmap in ARGB format). After getting the byte array of the preview data you should be able to encode it as a PNG or JPEG or whatever compressed image format you prefer. Best of luck.
I solved the problem of mirror inverted video recording through
Front-Camera
:the one line that solved my problem is:
Full Code:
XAML code
BackEnd C# code
This piece of code helped me after tens of efforts..!