I created a video in my cellphone holding the phone in portrait mode. The video is 720p and it looks perfectly fine in cell phone. I copied it on computer and when viewing it, the video looks 90 degrees anti-clockwise rotated. It is confusing for me that why it happened. How can I rotate the copied video back to 90-degrees without re-enconding the video.
-
It has been answered to death already. Not possible, unless container supports it or you are using MJPEG codec, which you are not.– v010dyaMay 4, 2015 at 16:48
-
1@Volodya ok, deleted my answer, but might be better suggest a duplicate instead of downvoting it.– p2orMay 4, 2015 at 16:53
-
@poor I've clicked downvote on your answer by some weird accident. Tried to undo, but it didn't let me.– v010dyaMay 4, 2015 at 16:56
-
1Apparently my answer doesn't solve your issue. Please let us know, what else you need or edit your question.– p2orMay 20, 2015 at 9:19
-
1@poor Yet another drive-by-question.– lloganSep 6, 2015 at 17:34
1 Answer
Rotate without re-encoding
You can add rotation metadata:
ffmpeg -i input.3gp -c copy -metadata:s:v rotate=90 output.3gp
-c copy
will enable stream copy mode, so it will just re-mux instead of re-encode.Player and device support for the
rotate
metadata may vary, so your player or device may not actually rotate the video. If that is the case you may have to manually rotate within the player, or re-encode.
Rotate with re-encoding
When re-encoding ffmpeg
will automatically rotate the video. The rotate metadata/sidedata will not be copied from the input (which is a good thing).
ffmpeg -i input output
If it doesn't work for you then your build is too old. Refer to the FFmpeg Download page.