Rotate CGImage taken from video frame
Depends on whether you are using the front camera or the back camera
int frontCameraImageOrientation = UIImageOrientationLeftMirrored;
int backCameraImageOrientation = UIImageOrientationRight;
UIImage *image = [[UIImage alloc] initWithCGImage:newImage scale:(CGFloat)1.0 orientation:frontCameraImageOrientation];
rotate video with ffmpeg library for iPhone
If you are using AVAssetWriter to write the movie then you can use the transform property on the AVAssetWriterInput. This will write a display transform property into the header of the movie. If you need the frames of the move to literally be rotated then you will need to do the transform before saving each image of the movie. Check out this post for a similar discussion.
The method you use really depends on how you display the video. If you display it using a player such as Quicktime or the iPhone's movie player, then you should use the transform property. If you are processing individual frames of the movie, then you will need to perform the rotation. Rotating the video can be done on the images or on the layer they are displayed on. The only way to get a true movie rotation is to rotate each frame. If this is only for display purposes then I recommend using the transform property, or rotating the layer the movie is displayed on.
Related Topics
The App Delegate Must Implement the Window Property If It Wants to Use a Main Storyboard File Swift
Xcode 6 Save for Enterprise Deployment Does Not Create Plist for IPA Anymore
Google Maps iOS Sdk, Getting Directions Between 2 Locations
Xcode 8 - Missing Files Warnings
Grouped Uitableview Remove Outer Separator Line
Cookie Sharing Between Multiple Wkwebviews
Find Current Country from iPhone Device
Hide Keyboard When Scroll Uitableview
Bundle.Main.Path(Forresource:Oftype:Indirectory:) Returns Nil
Canopenurl - This App Is Not Allowed to Query for Scheme Instragram
What Is a Provisioning Profile Used for When Developing iPhone Applications
Keeping the Contentoffset in a Uicollectionview While Rotating Interface Orientation
Cocoapods Could Not Find Compatible Versions for Pod "Firebase/Core" | Cloud_Firestore, Flutter
Storyboard Reference in Xcode, Where Should We Use It
Multiple Locations on Map (Using Mkmapitem and Clgeocoder)
Autolayout, Unable to Simultaneously Satisfy Constraints
Code Signing Error: Application Failed Codesign Verification
"Too Many Symbol Files" After Successfully Submitting My Apps