Rotation gets lost with copy mode

Started by batmanundrobin, August 04, 2016, 05:33:37 AM

Previous topic - Next topic

batmanundrobin

I find it very cool that avidemux can cut mp4 videos from mobile phone very fast in copy mode! But there seems to be a flaw with the rotation flag in the video. I have some videos where the phone had been turned when recording (90Ã,°, 180Ã,°, 270Ã,°). When I look at those in windows-mediaplayer (win10), they are displayed like they should: floor at the bottom sky at the top (there seems to be kind of flag that the phone sets in the movie, to enable an auto rotation by player software). When I look at those in avidemux, they are displayed wrongly (floor at the top e.g.), when I cut them and save to a new file, the file is displayed wrongly in every player software. I know I could add a filter for rotation, but then it needs to be reencoded (not copy mode), which takes longer and could lead to quality loss.
Is there a way to overcome this? Or could you implement an improvement, so that the flag is maintained in the output file?
Thank you anyway for your great software!

Jan Gruuthuse

#1
Without re-encoding, you could try with a recent ffmpeg:
ffmpeg -i input.mp4 -metadata:s:v rotate="90" -codec copy output.mp4

rotate =
  0 = landscape
90 = portrait
180 = landscape upsidedown
270 = portrait  upsidedown

I've not tested this procedure, the player software needs to support metadata 'rotate' to.

zakk

I may be wrong, but the only flags I know in Avidemux are the audio shift and the display width with mkv containers.