Search code examples
python-3.xffmpegpyffmpeg

ffmpeg convert one image to video


At the moment I can convert image sequence to video. But the current requirement is to convert one image into a video. And can achieve some special effects.

For example:

  1. fade in/out

  2. flash in/out

  3. pan top/bottom/left/right

  4. zoom in/out


Solution

  • zoomin example:

    ffmpeg -i infile -filter_complex "scale=iw*10:-1,zoompan=z='zoom+0.01':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':s={output_width}x{output_height}" -t {duration} -y -shortest -c:v libx264 outfile