0

I am having a single Image which I want to slide (Transition) from right to Left and stop at the end point and convert that into Video using FFMPEG. Although there are many posts regarding transitions but I couldn't find transition for single image to Video.

I had used the solution from this question:

ffmpeg -i C:\Sagar\Projects\Demos\Canvas\Canvas\BoxImage\1\output.png -i C:\Sagar\Projects\Demos\Canvas\Canvas\BoxImage\1\output.png -filter_complex "[0:v][1:v]overlay=x='if(lte(-w+(t)*100,w/2),-w+(t)*100,w/2)':y=0[out]" -map '[out]' -y C:\Sagar\Projects\Demos\Canvas\Canvas\BoxImage\1\outputout.mp4

but gives an error "Invalid stream specifier [out]":

Invalid stream specifier [out]

I have also tried

ffmpeg -f lavfi -i "color=black:d=15:s=1920x1080[background];movie='C:\Sagar\Projects\Demos\Canvas\Canvas\BoxImage\2\output.png' [overlay];[background][overlay]overlay='W-n:(H-h)/2'" C:\Sagar\Projects\Demos\Canvas\Canvas\BoxImage\2\outputoutput.mp4

But it still gives me error as below

error 2

slhck
  • 235,242

1 Answers1

0

Assuming you want the background to be black, use

ffmpeg -loop 1 -i img.png -filter_complex 
       "split=2[bg][slider];[bg]drawbox=c=black:t=fill[bg];
        [bg][slider]overlay=x='max(W-(w/4)*t,0)':y=0" -t 10 out.mp4

This will create a 10-second video in which the the images slides from right to left in 4 seconds and then stops there.

Gyan
  • 38,955