如何在Windows Phone 8中使用新的相机API进行视频录制

时间:2014-02-19 14:55:18

标签: windows-phone-8

我是否可以使用适用于Windows Phone 8的新型Camera API捕获,保存和播放视频。我已经找到了大量关于捕获和保存图片的信息,但我想成为能够用Video做同样的事情。

我有一个开始,但执行录制,保存和播放是我被困的地方

videoCaptureDevice = await AudioVideoCaptureDevice.OpenAsync(CameraSensorLocation.Back, AudioVideoCaptureDevice.GetAvailableCaptureResolutions(CameraSensorLocation.Back).First()); 


        // Initialize the camera if it exists on the device.
        try
        {
            if (videoCaptureDevice != null)
            {
                //// Create the VideoBrush for the viewfinder.
                videoRecorderBrush = new VideoBrush();
                videoRecorderBrush.SetSource(videoCaptureDevice);

                //// Display the viewfinder image on the rectangle.
                viewfinderRectangle.Fill = videoRecorderBrush;

                // Set the button state and the message.
                UpdateUI(ButtonState.Initialized, "Tap to start recording...");
            }
            else
            {
                // Disable buttons when the camera is not supported by the device.
                UpdateUI(ButtonState.CameraNotSupported, "A camera is not supported on this device.");
            }
        }
        catch(Exception ex)
        {
            MessageBox.Show("exception "+ex);
        }

0 个答案:

没有答案