Here is a MediaInfo data from an video taken in portrait mode on my phone:
Width : 1920 pixels
Height : 1080 pixels
Display aspect ratio : 16:9
The "Display aspect ratio" should be 9:16. This is causing problems when I try to edit the file in OpenShot.
If I run the file through a converter the Display Aspect Ratio changes to .563 and then it works fine in OpenShot.
Is there a way just change the metadata without running it through a converter?
+ Reply to Thread
Results 1 to 10 of 10
-
-
Since we don't have the FULL mediainfo data, this is just a guess, but:
I suspect that the recording was supposed to be portrait mode and was shot with a phone/cam that normally records in landscape mode and this particular shot was rotated to achieve the portait mode. And, instead of it recording it directly in 1080x1920, it recorded as 1920x1080 with rotational metadata.
My guess is also, that whatever you are using to view/edit is not recognizing such metadata.
If this is true, and if you cannot work with tools that DO support rotation, your only recourse is to do what you did and manually rotate and then re-encode (probably losing some quality in the process).
If my hunch is wrong, please enlighten us with further details.
Scott -
If your video is avc or hevc you could try my clever Ffmpeg-GUI to change the aspect ratio without reencoding.
-
As suggested by Cornucopia, most likely Rotation was set to 90° by the recording app. This information is present in mediainfo. The AR itself is correct. Such files will be played in portrait mode by video players such as mpc-hc.
The issue is however that the rotation flag is not supported by your editing app.
If you are re-encoding the file anyway you should just rotate it in your editing app. Otherwise, you can cut with your app then set the rotation flag again with ffmpeg when you are done. -
@ProWo, you presume the original file doesn't have the appropriate metadata, and if that is true your method might be valid to add it.
I am presuming the original file already HAD the metadata (just about ALL devices, phones, cams I know of DO), but that the apps used did not support/recognize/honor that metadata. If that is the case, your method will do nothing to help. (Unless it creates different/additional metadata in some other section of the file that DOES get recognized)
More info is necessary...
Scott -
-
Setting rotation in container with ffmpeg should not be confused with changing AR.
-
FWIW, from my experience:
My mobile phone wraps the files in .mp4 containers which support the rotation flag. For example a picture taken in portrait (phone held upright) mode will have the rotaion flag 90 degrees. Media info will however report it as 16:9, width 1920, height 1080. When the player recognizes the flag, it will display the picture upright, i.e. as 9:16. If the player does not recognize the flag or when the container is changed, the portrait picture will be displayed as a landscape picture with DAR 16:9. Also, the demuxed video stream will normally not keep the rotation info in its metadata; it's in the container only.
Hence in order to make it independent of the flags and container I always reencode the video with something like
Code:ffmpeg.exe -i "source.mp4" -map 0 -c:a copy -c:v libx264 -preset medium -crf 18 -filter:v "scale=-2:1080, pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9" "out.mp4"
Last edited by Sharc; 2nd Jan 2021 at 04:19.
-
Here is a MediaInfo data from an video taken in portrait mode on my phone:
[Attachment 54471 - Click to enlarge] (from)
Similar Threads
-
Improper Display Aspect Ratio?
By GrouseHiker in forum Capturing and VCRReplies: 8Last Post: 27th Apr 2020, 18:55 -
Problem with display aspect ratio when burning ISO for DVD
By br1anstorm in forum Newbie / General discussionsReplies: 23Last Post: 15th Feb 2019, 16:37 -
Video displaying wrong aspect ratio on TV
By sasha007 in forum Video ConversionReplies: 4Last Post: 3rd Mar 2018, 13:23 -
Display aspect ratio Help
By Caiosouza in forum RestorationReplies: 11Last Post: 1st Oct 2017, 15:58 -
Help re-encoding mkv to fix display aspect ratio
By bowiebowie in forum Video ConversionReplies: 13Last Post: 17th May 2016, 10:19