[FFmpeg-user] How to add black bars as replacement for height?

Robin van der Linden linden at venom.one
Tue Nov 8 10:06:06 EET 2022


Thanks for your reply, Moritz,

I now came to the following cmd:

-vf 
"scale={stream["width"]}:{stream["height"]}:force_original_aspect_ratio=decrease,pad={stream["width"]}:{stream["height"]}:(ow-iw)/2:(oh-ih)/2,setsar=1"

{stream["height"]} and {stream["width"]} are just placeholders


Thanks for your help.

Am 2022-11-08 08:05, schrieb Moritz Barsnick:
> On Tue, Nov 08, 2022 at 03:02:36 +0100, FFmpeg user discussions wrote:
>> Can I use ffmpeg to convert a 1920x800 resolution clip to 1920x1080? 
>> The
>> goal is to fill the remaining pixels with a true black bar.
> 
> Have a look at the pad filter:
> https://ffmpeg.org/ffmpeg-filters.html#pad-1
> 
> Something like
> $ ffmpeg -i inputfile -vf "pad=h=1080:y=(oh-ih)/2" outputfile
> 
> The "y" expression is for centering the video vertically.
> 
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".

-- 
Grüße / Kind regards,

Robin van der Linden


More information about the ffmpeg-user mailing list