so i have a little problem with my current ffmpeg script. I'm trying to keep the video in its original resolution if its not over 1280×720. But anything that is above 1280×720, down-scale/resize it to 1280×720.
Currently i have the below filter:
-filter:v "scale='min(1280,iw)':min'(720,ih)':force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2"
However, this by the looks of it changes all videos to 1280×720, which then causes black bars on videos that are for example recorded on phone etc...
Example:
If 1920x1080 > downscale to 1280×720
If anything above 1280×720 > downscale to 1280×720
If 1280×720 > Keep it
If anything below 1280×720 > Keep the original resolution
Hope anyone could help me with this. Thank you.
,pad=...
or changepad=...
part topad='min(1280,iw)':'min(720,iw/16*9)':(ow-iw)/2:(oh-ih)/2
orpad='min(1280,iw)':'min(720,ih)':(ow-iw)/2:(oh-ih)/2
,pad=...
worked.