I wanted to scale a video input (1.webm) and keeping it's aspect ratio, then overlay to make it centered, with following command:
ffmpeg -y -hide_banner -i 1.webm -filter_complex "color=color=Black:size=640x480:d=7.420[bg];[0:0]scale=w='iwmin(640/iw,480/ih)':h='ihmin(640/iw,480/ih)'[scaled];[bg][scaled]overlay=x=(W-w)/2:y=(H-h)/2" -an -f rawvideo -c:v rawvideo -s:v 640x480 -pixel_format yuv420p 1.yuv
the output seem corrupted, dark area in original video turns purple or pink, and it's blinking.
I edited the command to remove the overlay filter, with following command:
ffmpeg -y -hide_banner -i 1.webm -filter_complex "[0:0]scale=w='iwmin(640/iw,480/ih)':h='ihmin(640/iw,480/ih)'" -an -f rawvideo -c:v rawvideo -s:v 640x480 -pixel_format yuv420p 1.yuv
this time, the output seem fine.
I can't figure out what is going wrong, please help.