rotate video with ffmpeg library for iPhone
Is it possible to adjust the orientation of a video programmatically with the ffmeg library usin开发者_运维问答g objective-c?
I have a recorded video (mov) file that is playing in the wrong orientation and would like to perform the adjustment.
If ffmpeg is not the right approach, what is the simplest way to take a video and rotate it by 90 degrees?
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.
精彩评论