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.
Rotate without re-encoding
You can add rotation metadata:
ffmpeg -i input.3gp -c copy -metadata:s:v rotate=90 output.3gp
-c copywill enable stream copy mode, so it will just re-mux instead of re-encode.
Player and device support for the
rotatemetadata 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
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.