Search code examples
iosavfoundationgpuimage

GPUImage wrong rotation of video


I record video using AVCaptureSession. After seeing the recorded video file (from iTunes) it always has the correct rotation (landscape right and landscape left). However, when I show the video using GPUImageView and GPUImageMovie, it will be upside down for landscape left.

Any ideas would be extremely helpful!

UPDATE

Now I noticed that when I take a screenshot from the video using AVAssetImageGenerator, that is also upside down.


Solution

  • Solved it by setting the input rotation:

    if ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationLandscapeLeft)
    {
        [currentFilter setInputRotation:kGPUImageRotate180 atIndex:0];
    }