I have the following ffmpeg command:

ffmpeg -f concat -i inputs.txt -vf "scale=iw*min(1920/iw\,1080/ih):ih*min(1920/iw\,1080/ih),pad=1920:1080:(1920-iw)/2:(1080-ih)/2:black" output.mp4

This command collects a bunch of different videos (specified on inputs.txt), scale them to 1920x1080 and pad the empty areas with black. This works perfectly as-is, regardless of the size of my inputs.

Now, I want to have different colors for the padding areas, for example "red" on the left side and "blue" on the right side, instead of full back on both sides. Is that even possible with ffmpeg? How?

  • overlay on picture → ffmpeg -f concat -safe 0 -i /tmp/1.txt -vf " color=red:640x720[l]; color=blue:640x720[r]; [l][r]hstack[b]; [0]scale=1280:720:force_original_aspect_ratio=decrease, pad=1280:720:-1:-1:black@0, setsar=1[f]; [b][f]overlay=shortest=1 " /tmp/out.mp4 Commented Jun 3 at 3:51


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.