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 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
[Attachment 59239 - Click to enlarge]
+ Reply to Thread
Results 1 to 5 of 5
-
-
Thank you for the note.
I know how to crop it but how I know if I have to crop 2 pixels height or 3 pixels width? Is this possible?
Basically how I know where are the black borders to crop them?
Thanks! -
for border detection something like:
Code:@ffmpeg -skip_frame nokey -y -hide_banner -loglevel 32 -stats -i "%1" -vf cropdetect -an -f null -
and depends on video compression used there may be some limitation on possible crop sizes (usually video width/height must be dividable by at least 2 and usually by 4, some encoders may desire that overall video width/height must be dividable by 8/16/32 to avoid internal workarounds for aligning CPU memory access).
Similar Threads
-
Filling black borders in Fullscreen mode
By butterw in forum Software PlayingReplies: 133Last Post: 5th Feb 2025, 13:10 -
Auto Crop Black Borders
By m00511 in forum Video ConversionReplies: 17Last Post: 4th Apr 2022, 22:03 -
Should I keep black borders when resizing videos?
By Bassquake in forum Video ConversionReplies: 7Last Post: 6th May 2020, 05:35 -
Add/Remove black borders in the top/bottom of a video without reencoding.
By November in forum EditingReplies: 10Last Post: 11th May 2019, 07:48 -
FFMPEG - Black Borders - [Please help]
By 21dresden21 in forum Video Streaming DownloadingReplies: 2Last Post: 12th Feb 2019, 07:51