Using ffmpeg 4.4, I am trying to crop video and actually animate the width in time using sendcmd
+ crop
. This however leaves artefacts (either green color or the video being repainted repeatedly horizontally/vertically) rendered outside of the cropped area.
Commands to replicate:
ffmpeg -f lavfi -i color=color=0xff0000:size=1280x720:rate=25 -filter_complex_script filter.txt -map [v] -t 4 out.mp4 -y
filter.txt
movie=video.mp4,sendcmd=c='0 [expr] crop w (N*10)+10',crop[v];
[0][v]overlay=x=n:eof_action=pass:eval=frame[v]
Any idea how to get rid of these artefacts?
Or maybe there is some alternative ffmpeg filter that would do the crop work with eval=frame instead of sendcmd?
I ended up using little overlay hack to simulate crop:
fiter.txt
Issue with crop reported on https://trac.ffmpeg.org/ticket/9454