[FFmpeg-user] How to remove rotation of a video?

Ulf Zibis Ulf.Zibis at gmx.de
Tue Mar 3 17:33:44 EET 2020


Am 01.03.20 um 14:55 schrieb Reino Wijnsma:
> On 2020-02-27T13:23:02+0100, Ulf Zibis <Ulf.Zibis at gmx.de> wrote:
>> unfortunately I now see, that there is a problem with that. Some other
>> tags were completely removed, e.g. creation time, geo tags, etc
>>
>> What must I do to preserve all tags?
> I believe the -map_metadata option is what you're looking for.
>
> ffmpeg -i <input> -map_metadata 0 -metadata:s:v rotate=0 -c copy <output>

It still "eats" few tags (e.g. mdhd_Duration), but creation time is 
preserved. :-)

At the first view I missed the geo tag. In the original, mediainfo shows:
Encoded date                             : UTC 2020-02-05 19:55:01
Tagged date                              : UTC 2020-02-05 19:55:01
xyz                                      : -00.7655-047.1715/
But after transcoding with ffmpeg it only shows:
Encoded date                             : UTC 2020-02-05 19:55:01
Tagged date                              : UTC 2020-02-05 19:55:01

ffprobe from the original shows:
     creation_time   : 2020-02-05T19:55:01.000000Z
     location        : -00.7655-047.1715/
     location-eng    : -00.7655-047.1715/
And after transcoding with ffmpeg it shows:
     creation_time   : 2020-02-05T19:55:01.000000Z
     location-eng    : -00.7655-047.1715/
     location        : -00.7655-047.1715/

So it seems, that -map_metadata maps "xyz" to "location" and 
"location_eng" and mediainfo is not able to detect the latter.

And ffprobe does not list one of "Encoded date" or "Tagged date".

Much thanks for your hint!

> P.s. top-posting here is considered rude, so please stop it.

In case of 1-liners I sometimes forget this, sorry.

-Ulf




More information about the ffmpeg-user mailing list