显示当前视频在的Windows Phone 8使用AudioVideoCaptureDevice? [英] Display Current Video in Windows Phone 8 using AudioVideoCaptureDevice?
问题描述
我已经成功地设置代码为初始化,可以开始/使用AudioVideoCaptureDevice停止录制视频一款Windows Phone 8应用。 (保存到一个IRandomAccessStream)
I've managed to setup code for a Windows Phone 8 Application that initializes and can start/stop recording video using an AudioVideoCaptureDevice. (saves it to an IRandomAccessStream)
//Initialize Camera Recording
Windows.Foundation.Size resolution = new Windows.Foundation.Size(640, 480);
captureDevice = await AudioVideoCaptureDevice.OpenAsync(CameraSensorLocation.Back, resolution);
captureDevice.VideoEncodingFormat = CameraCaptureVideoFormat.H264;
captureDevice.AudioEncodingFormat = CameraCaptureAudioFormat.Aac;
captureDevice.RecordingFailed += captureDevice_RecordingFailed;
不过,我无法弄清楚如何挂钩这个记录到一个的VideoBrush显示记录到用户。我希望用户能够看到,因为它正在发生...
However, I cannot figure out how to hook this recording up to a VideoBrush to display the recording to the user. I want the user to be able to see the video they are recording as it is happening...
我知道他们正在录制的视频是一个教程,说明如何使用要做到这一点旧的API为Windows Phone 7(CaptureSource,VideoDevice等),但我特别需要使用AudioVideoCaptureDevice记录。任何人都知道如何在屏幕上显示该视频?
I know there is a tutorial that shows how to do this using the old APIs for Windows Phone 7 (CaptureSource, VideoDevice, etc.) but I specifically need to use the AudioVideoCaptureDevice to record. Anyone know how to display this video on screen?
推荐答案
好吧,我能解决我的问题。
Well, I was able to solve my problem.
显然没有在Microsoft.Devices库,包含的VideoBrush类的扩展。
因此,为了设置的VideoBrush源的AudioVideoCaptureDevice,您必须首先:
Apparently there is a library in Microsoft.Devices that contains extensions for the VideoBrush class. Therefore, in order to set the videobrush source to an AudioVideoCaptureDevice, you must first have:
using Microsoft.Devices;
在其中您使用的VideoBrush的类的顶部。
希望这能帮助别人。
at the top of your class in which your using the videobrush. Hope this is able to help someone else.
这篇关于显示当前视频在的Windows Phone 8使用AudioVideoCaptureDevice?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!