AVCaptureVideoDataOutput and AVCaptureVideoStabilizationModeCinematic preview lag

I have scratched my head for years but no outcome on this. When I have AVCaptureVideoDataOutput set and OpenGLES rendering of frames using AVCaptureVideoStabilizationModeCinematic, there is considerable delay in the preview. This can easily be reproduced with RosyWriter sample code by inserting a line


_videoConnection.preferredVideoStabilizationMode = AVCaptureVideoStabilizationModeCinematic;


The delay is much much much less if I use AVCaptureVideoPreviewLayer. Is there a way to eliminate the lag when rendering frames using OpenGLES, or I have no way but to use AVCaptureVideoPreviewLayer.

Replies

Can any one among Apple engineers confirm how AVCaptureVideoPreviewLayer achieves magic of little preview lag but AVCaptureVideoDataOutput receives frames so late that it makes preview almost useless if frame are to be manually rendered using OpenGLES like in RosyWriter? Can this be fixed or has a workaround?

Waiting for an answer please.

Did you ever find an answer to this? I would still like to know how to do this.