Log in

View Full Version : FFmpeg - how to remove black borders when resizing an image


mapg
3rd June 2021, 07:16
Hi everyone,

I am creating some thumbnails using FFmpeg and I see that some black borders are created when I resize them.

I guess this is happening because the video source dimension doesn't match exactly the target dimension, so FFmpeg (https://www.videohelp.com/software/ffmpeg) fills out the blank space with this black color.

My question is ...

Can I change this "black color" used by FFmpeg by default so I can match these extra borders added with the background of my application?

If this is not possible ...

Can I convert these black borders to a transparent area so I can create a PNG to match my background which has a different color (a kind of light green)

I have attached an example where you will see two black pixels height in the bottom zone of the picture.

This is what I want to convert to transparent or being able to choose my own color.

Any idea to solve this issue will be very helpful for me?

Thank you very much in advance!

Mapg

https://i.stack.imgur.com/aHI9k.jpg