Skip to main content

Scrolling Image Video

FFmpeg can be used to convert a large image into a scrolling video by using the command line interface. The basic command format for creating a scrolling video from an image is:

ffmpeg -loop 1 -i input_image.jpg -vf "zoompan=z='min(zoom+0.0015,1.5)':d=125:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)', fade=out:st=3:d=1" -t duration output_video.mp4

Here, "input_image.jpg" is the name of the image that you want to convert into a scrolling video, "output_video.mp4" is the name of the video file that you want to create, and "duration" is the length of the video in seconds.

The zoompan filter is used to zoom in and pan through the image. The z parameter controls the zoom level, d parameter specifies the duration of the pan in frames, and x and y parameters specify the position of the pan.

The fade=out:st=3:d=1 is used to add a fade out effect to the video that starts after 3 seconds and lasts for 1 second.

For example, to convert an image called "image.jpg" into a scrolling video that is 10 seconds long and save it as "video.mp4", you would use the following command:

ffmpeg -loop 1 -i image.jpg -vf "zoompan=z='min(zoom+0.0015,1.5)':d=125:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)', fade=out:st=3:d=1" -t 10 video.mp4

You can also adjust the duration of the pan, zoom level, and fade effect to achieve the desired result.

Alternative Scrolling Examples

Vertical scroll example:

ffmpeg -loop 1 -i input.png -vf "scroll=vertical=0.01,crop=iw:600:0:0,format=yuv420p" -t 10 output.mp4

Horizontal scroll example:

ffmpeg -loop 1 -i input.png -vf "scroll=horizontal=0.01,crop=800:600:0:0,format=yuv420p" -t 10 output.mp4