Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
25th September 2020, 23:34 | #1 | Link |
Registered User
Join Date: Apr 2016
Posts: 85
|
Resize + Pad to keep image centered
I have a 1998x998 source that I need to "fit all" within a 1920x1080 container.
That means resizing 1998x998 to ~1920x959.04 and padding top and bottom to fill the height to 1080. I'm currently scaling first to 1920x960 then padding top and bottom but then I'm not getting a perfect 1:1 compared to other softwares. Ideally I'd like to preserve subpixel accuracy but I'm struggling with using src_top, src_height, etc. Anyone know of a convenience function to resize & pad while keeping the image perfectly centered? Last edited by groucho86; 25th September 2020 at 23:54. Reason: Typo |
26th September 2020, 07:43 | #2 | Link | ||
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
Quote:
Quote:
1998x998->1998x1124 (pad) -> 1920x1080 (resize) that's the only different way that jumps to mind,.. |
||
26th September 2020, 14:15 | #3 | Link |
Registered User
Join Date: May 2006
Posts: 3,997
|
You could try the ffmpeg filter
Code:
-filter:v "scale=1920:-2, pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9" Last edited by Sharc; 26th September 2020 at 14:19. |
Thread Tools | Search this Thread |
Display Modes | |
|
|