Do videos have metadata for orientation?

Chat about just about anything else
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 30 days after creation.
Locked
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Do videos have metadata for orientation?

Post by jimallyn »

Is there something in videos that says which way is up? I recently videoed part of an event I attended, using my Samsung Galaxy S5 Android phone. I recorded in mp4 format. When I got home, I transferred the video to my computer and viewed it; everything looked fine. I posted it on Facebook, and it was upside down. So I deleted it from Facebook and played it on the phone. Sure enough, it was upside down. (Must not have noticed how I was holding the phone when I took it.) So, question number one: why did it play right side up on my Mint 17.3 box?

Next, I used Transmageddon to flip the upside down video right side up. I then posted that flipped version of the video on Facebook. And it displays upside down on Facebook, too! So, this brings us to question number two: is there some metadata or something in an mp4 file that controls the orientation the video plays in? Why would both the original version, which I apparently recorded with the phone upside down, and the Transmageddon inverted version BOTH play upside down on Facebook? And if there is something in metadata, how would I change it?
Last edited by LockBot on Wed Dec 07, 2022 4:01 am, edited 1 time in total.
Reason: Topic automatically closed 30 days after creation. New replies are no longer allowed.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: Do videos have metadata for orientation?

Post by trytip »

i believe you needed to delete your facebook cookies or the file uploaded was on delay even if you deleted it, i'm sure it was stored in cache. (when you delete something in facebook comments, pictures, notes etc it's not gone but greyed out where only mods can see it)
https://addpipe.com/blog/mp4-rotation-m ... deo-files/

changing metadata can be done when you use "copy" instead of re-encoding

Code: Select all

ffmpeg -i input.mp4 -metadata:s:v rotate=180 -vcodec copy -acodec copy output.mp4
https://stackoverflow.com/questions/102 ... ion-in-mp4
Image
User avatar
GS3
Level 8
Level 8
Posts: 2384
Joined: Fri Jan 06, 2017 7:51 am

Re: Do videos have metadata for orientation?

Post by GS3 »

This problem is similar to JPEG file rotation in that some programs will support the rotation flag and some will not. In JPEG I find it is sometimes better to do a real rotation and obviate any rotation flag problems.

Regarding MP4 video, the last two posts at https://superuser.com/questions/1307158/ seem to be the answer the OP is looking for.
Please do not use animated GIFs in avatars because many of us find them distracting and obnoxious. Thank you.
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Do videos have metadata for orientation?

Post by jimallyn »

Thanks to both of you. I won't be able to try it for a day or so, but it sounds like I will be able to do it. In the future, I'll be more careful to hold the phone correctly when shooting pictures or videos.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
GS3
Level 8
Level 8
Posts: 2384
Joined: Fri Jan 06, 2017 7:51 am

Re: Do videos have metadata for orientation?

Post by GS3 »

jimallyn wrote: Fri May 11, 2018 4:21 am In the future, I'll be more careful to hold the phone correctly when shooting pictures or videos.
Learning to hold the phone correctly is very important. My wife just dropped her Samsung and cracked the screen. :)

I remember when she had an iPhone I had to deal with the video rotation issue but I do not remember having to do it lately with the Samsung. Still, we often process videos in order to reduce size, crop, etc. I hate it when someone sends me a 10 second, 15 MB video.

And people who shoot vertically in 16:9. There ought to be a law about that! :)
Please do not use animated GIFs in avatars because many of us find them distracting and obnoxious. Thank you.
Locked

Return to “Open Chat”