从前置摄像头拍摄时总是看到镜像 iOS 5.0
从前置摄像头捕获数据时,我总是获得镜像,如何才能获得在预览窗口中看到的内容。我已将 videoMirrored
设置为 TRUE
。以下是代码片段:
AVCaptureConnection *lConnection = nil;
for ( AVCaptureConnection *connection in [lHandle->m_output connections]) {
for ( AVCaptureInputPort *port in [connection inputPorts] ) {
if ( [[port mediaType] isEqual:AVMediaTypeVideo] ) {
lConnection = connection;
break;
}
}
}
if ([lConnection isVideoOrientationSupported])
[lConnection setVideoOrientation:AVCaptureVideoOrientationPortrait];
if ([lConnection isVideoMirroringSupported])
[lConnection setVideoMirrored:TRUE];
将 setVideoMirrored
更改为 True/False
也不会改变任何内容 (isVideoMirroringSupported
返回成功)
While capturing data from Front camera I am always getting Mirror image, how can I get what I am seeing in my preview window. I have set videoMirrored
to be TRUE
. Following is the code snippet:
AVCaptureConnection *lConnection = nil;
for ( AVCaptureConnection *connection in [lHandle->m_output connections]) {
for ( AVCaptureInputPort *port in [connection inputPorts] ) {
if ( [[port mediaType] isEqual:AVMediaTypeVideo] ) {
lConnection = connection;
break;
}
}
}
if ([lConnection isVideoOrientationSupported])
[lConnection setVideoOrientation:AVCaptureVideoOrientationPortrait];
if ([lConnection isVideoMirroringSupported])
[lConnection setVideoMirrored:TRUE];
Changing setVideoMirrored
to True/False
also doesn't change anything
(isVideoMirroringSupported
returns Success)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用以下代码翻转镜像。
Flip the mirrored image with the following code.
Swift
版本:Swift
version:您可以使用
withHorizontallyFlippedOrientation()
来翻转UIImage。You can use the
withHorizontallyFlippedOrientation()
to flip an UIImage.