I have a QTCaptureSession set up which has as its input a QTCaptureDeviceInput (initialized with a QTCaptureDevice corresponding to a webcam); a QTCaptureLayer has had its session set to be this QTCaptureSession. This all works swimmingly.

I would like, however, to vertically reflect (i.e. "mirror") the captured video. Rather than using a QTCaptureVideoPreviewOutput, a CAOpenGLLayer, and a custom kernel, is there a way built-in to QTKit to do this?

有帮助吗?

解决方案

Since QTCaptureLayer is a subclass of CALayer, we can just set the affine transform on the QTCaptureLayer to achieve this effect.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top