lundi 7 septembre 2020

How to use if statement to add color overlay in FFMPEG

ffmpeg -i input.mp4 -y -t 10 -vf drawbox=x=0:y=0:w=200:h=200:color='if(1==1\,red\,green)':t=fill output.mp4

I tried to test how can I use if statement to add colored square overlay to a video, but got following error.

Cannot find color 'if(1==1,red,green)' [AVFilterGraph @ 000002d24a659440] Error initializing filter 'drawbox' with args 'x=0:y=0:w=200:h=200:color=if(1==1,red,green):t=fill' Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #0:0

Aucun commentaire:

Enregistrer un commentaire