WP摄像头录像默认成像是倒的, 要怎么正过来呢
本帖最后由 johnny_yeung 于 2013-08-15 20:02:37 编辑 使用 AudioVideoCaptureDevice, 貌似说是需设置角度, 但没找到具体是在哪里设置(比如android的setOrientationHint方法)
因为视频需要上传到服务端, 所以不能使用显示时再旋转的方法
private AudioVideoCaptureDevice m_captureDevice;
/// <summary>
/// 初始化捕获设备,
/// </summary>
private async void Init()
{
try
{
//获取视频捕获设备
m_captureDevice = await AudioVideoCaptureDevice.OpenForVideoOnlyAsync(CameraSensorLocation.Back, new Windows.Foundation.Size(640, 480));
TheVideoBrush.SetSource(m_captureDevice);
//设置视频数据格式
m_captureDevice.VideoEncodingFormat = CameraCaptureVideoFormat.H264;
}
catch (Exception e)
{
throw e;
}
}
m_captureDevice.SetProperty(KnownCameraGeneralProperties.EncodeWithOrientation,
sensorLocation == CameraSensorLocation.Back ? m_captureDevice.SensorRotationInDegrees :- m_captureDevice.SensorRotationInDegrees);