問題描述
Facebook不尊重AVMutableCompositionTrack上的preferredTransform標誌 (Facebook not Respecting preferredTransform flag on AVMutableCompositionTrack)
I have an AVMutableComposition track which I am rotating 180 degrees as follows :
if (shouldRotate) {
//Code to rotate original main video 180 degrees if required.
CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI);
a_compositionVideoTrack.preferredTransform = transform;
}
This works well and when I view the video or upload to YouTube it is correctly rotated. However when I upload to Facebook the video is upside down - it seems that Facebook does not care about / read the preferredTransform flag.
Can anyone suggest how I might fix this ? Just for extra information I am using the Facebook SDK for iOS to upload the videos.
Thank you in advance !
EDIT Actually this seems to be a bug either on Facebook or in the Facebook sdk. If I rotate by 90 degrees it works. If anyone can shed any light please do.
參考解法
方法 1:
This seems to be a bug - the only solution is to rotate the video once uploaded in Facebook itself.
(by GuybrushThreepwood、GuybrushThreepwood)