when i export a video asset via AVAssetExportSession the result file is in landspace mode. (file grabbed via itune->apps->file sharing->my app). how can i export the video asset in portrait mode (rotate it)?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- How to create a MediaClip from RenderTargetBitmap
- Unable to process app at this time due to a genera
- Safari blocks play() on video despite being called
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Laravel: What's the advantage of using the ass
- Open iOS 11 Files app via URL Scheme or some other
The video coming from the iPhone capture device are always landscape orientated whatever the device orientation is when capturing.
If you want to rotate your video, the 'simple' solution is to assign a transform to the video track of the exported session.
Create 2 mutable tracks in your AVComposition object :
Add your medias tracks to your composition's tracks :
After you added all your tracks, apply your transform to the video track of your composition :
(be carful that the transform had the upper left corner as origin, so the translation was needed after rotation, but tested on iPhone 4S, iOS 5.1, it seems that the rotation is now made around the center.)
When U transform the track meanwhile should set the composition renderSize since it may out of frame or appear with black block: