How to convert a video to 16:9 widescreen format aspect ratio | Max screen size, no padding

Published: 22 April 2021
on channel: The FFMPEG guy
1,654
27

Today, we show how to convert a video to 16:9 widescreen using ffmpeg, maximizing size, with no black padding. While the example converts a 4:3 video to a 16:9 video, the same technique can also be used to convert from / to any formats so that you get the right aspect ratio and size, maximizing screen space with no padding black bars.

ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
EXAMPLES
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
❶ Converting a video to 16:9 aspect ratio (HD, 1280 x 720), maximizing size with no black padding
→ ffmpeg -i input.mp4 -vf "scale=(iw*sar)*max(1280/(iw*sar)\,720/ih):ih*max(1280/(iw*sar)\,720/ih), crop=1280:720" output01.mp4

with:
*scale = FFMPEG video filter to resize a video
(iw*sar)*max(1280/(iw*sar)\,720/ih) = output width of the resized video = Resize width of video to at least 1280 (keeping original aspect ratio)
ih*max(1280/(iw*sar)\,720/ih) = output height of the resized video = Resize width of video to at least 720 (keeping original aspect ratio)

The scale transformation is then followed (chained) by a crop video filter:
crop = FFMPEG video filter to cut part of a video
1280 = The cropping width (around the reference point) for the output video
720 = The cropping height (around the reference point) for the output video
Note: In this scenario (2 parameters only for the crop video filter), the reference point is the center of the input video

❷ Converting a video to 16:9 aspect ratio (FHD, 1920 x 1080), maximizing size with no black padding
→ ffmpeg -i input.mp4 -vf "scale=(iw*sar)*max(1920/(iw*sar)\,1080/ih):ih*max(1920/(iw*sar)\,1080/ih), crop=1920:1080" output02.mp4

with:
*scale = FFMPEG video filter to resize a video
(iw*sar)*max(1920/(iw*sar)\,1080/ih) = output width of the resized video = Resize width of video to at least 1920 (keeping original aspect ratio)
ih*max(1920/(iw*sar)\,1080/ih) = output height of the resized video = Resize width of video to at least 1080 (keeping original aspect ratio)

The scale transformation is then followed (chained) by a crop video filter:
crop = FFMPEG video filter to cut part of a video
1920 = The cropping width (around the reference point) for the output video
1080 = The cropping height (around the reference point) for the output video
Note: In this scenario (2 parameters only for the crop video filter), the reference point is the center of the input video
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
→ Catch up with the FFMPEG guy Channel
   • ALL THE VIDEOS FROM THE CHANNEL  
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
MUSIC
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
→ The Engagement - Silent Partner
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
An FFMPEG question?
Ask the FFMPEG guy
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ


Watch video How to convert a video to 16:9 widescreen format aspect ratio | Max screen size, no padding online without registration, duration hours minute second in high quality. This video was added by user The FFMPEG guy 22 April 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,654 once and liked it 27 people.