How to change the AVMutableVideoCompositionLayerInstruction 's transform anchor point to center?

What I want is to make video 's rotation be from 0 to 90 degree in 0 ~ 2s.

Here is the code:
Code Block swift
let layerIns = AVMutableVideoCompositionLayerInstruction(assetTrack: track)
let endTransform = CGAffineTransform(rotationAngle: CGFloat(Double.pi / 2))
let timeRange = CMTimeRange(start: .zero, duration: CMTime(seconds: 2, preferredTimescale: 600))
layerIns.setTransformRamp(fromStart: .identity, toEnd: endTransform, timeRange: timeRange)

But the center of rotation is top-left corner.. Which makes rotation effect look strange.

I wonder how to change the video layer's anchor point to center point instead of top-left corner...

related question on StackOverFlow :Question Link
Have you tried using CGAffineTransformMakeTranslation to move the image relative to the rotation anchor?
How to change the AVMutableVideoCompositionLayerInstruction 's transform anchor point to center?
 
 
Q