VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. 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

    Image
    [Attachment 59239 - Click to enlarge]
    Quote Quote  
  2. You have to crop the video. Search this forum for related information.
    Quote Quote  
  3. 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!
    Quote Quote  
  4. for border detection something like:
    Code:
    @ffmpeg -skip_frame nokey -y -hide_banner -loglevel 32 -stats -i "%1" -vf cropdetect -an -f null -
    can be used, ready to be used crop syntax is provided at the end of each line...

    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).
    Quote Quote  
  5. Originally Posted by pandy View Post
    for border detection something like:
    Code:
    @ffmpeg -skip_frame nokey -y -hide_banner -loglevel 32 -stats -i "%1" -vf cropdetect -an -f null -
    can be used, ready to be used crop syntax is provided at the end of each line...

    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).
    Great! Sounds good.

    I will test it right now!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!