How to properly export CALayer on top of AVMutableComposition with AVAssetExportSession

前端 未结 2 491
面向向阳花
面向向阳花 2020-12-13 11:44

I know this question was asked before (for example here and here) but I just can\'t figure out what I\'m doing wrong.

I have an AVMutableComposition tha

相关标签:
2条回答
  • 2020-12-13 12:02
    Methods that fixing frames and points
    - (CGRect) fixRect:(CGRect)rect inRect:(CGRect)container
    {
        CGRect frame = rect;
        frame.origin.y = container.size.height - frame.origin.y - frame.size.height;
        return frame;
    }
    - (CGPoint) fixPoint:(CGPoint)point fromPoint:(CGSize)containerSize
    {
        CGPoint frame = point;
        frame.y = containerSize.height - frame.y;
        return frame;
    }
    
    0 讨论(0)
  • 2020-12-13 12:03

    For anyone who has the same problem as I had I've finally found an answer. There is a property of every CALayer called geometryFlipped wich you need to set to YES just before exporting and everything will be ok. More information here.

    0 讨论(0)
提交回复
热议问题