moving crop works for video, but I could not make it work for a (jpg) image. How to move an image in the video using ffmpeg?

Here is my try that does not work ($TST is a .jpg):

ffmpeg -ss 30 -i main.mkv -i $TST -filter_complex \
    chromakey=${CG}:.031:0.025,despill[a];[1]crop=w=1920:h=1080:x='t*in_w/3':y='t*in_h/3'[b];[b][a]overlay" \
    -c:v ffv1 -map 0:a -c:a copy -t 1s tstres.mkv

1 Answer 1


An image is treated by ffmpeg as video stream with one frame. For a crop animation to be effected, you need a stream of frames.

Add loop before the image input: -loop 1 -i $TST. Normally, you would be advised to limit the duration by also adding -t, but since you limit duration on the output, it is not necessary here.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.