Jay Taylor's notes

back to listing index

ffmpeg - Correct aspect ratio without re-encoding video file - Super User

[web search]
Original source (superuser.com)
Tags: video-encoding howto ffmpeg aspect-ratio mp4box superuser.com
Clipped on: 2024-06-30

Image (Asset 1/47) alt= $h - resolution height
x - aspect ratio width
y - aspect ratio height

Notes:

  • If you put -aspect x:y without -vf scale=$w:$h, the output will only have the change on display aspect ratio.

  • If you put -vf scale=$w:$h without -aspect x:y, the output will only have the change on the resolution.

  • The command -vf scale=$w:-1 or scale=-1:$h will not always provide the expected output so to make sure you get both change on resolution and aspect ratio, you can just use the above command line.

** I only tried this with input.mkv and output.mkv files since this is only what I am working on at the moment. Feel free to try this with the other file types.

MMM
2,85688 gold badges2929 silver badges4444 bronze badges
answered May 10, 2021 at 7:36
MrClay
2111 bronze badge
0

ffmpeg 4.3.2 -bsf:v h264_metadata=sample_aspect_ratio=x/y gives an error on DNxHR coded Quicktime files while MP4Box writes a second line of PAR into the metadata.

Width : 720 pixels Height : 540 pixels Display aspect ratio : 16:9 Original display aspect ratio : 4:3

I tested multiple players and even an NLE and so far all display the correct aspect ratio.

answered Mar 25, 2021 at 17:07

Your Answer

Community wiki

Not the answer you're looking for? Browse other questions tagged or ask your own question.

Linked

Related

Hot Network Questions

Question feed
Super User
Company
Stack Exchange Network

Site design / logo © 2024 Stack Exchange Inc; user contributions licensed under CC BY-SA. rev 2024.6.28.11669