<p>I originally thought I could handle this one, but I'm still new to FFmpeg and don't think I can solve this for you. Below follows what I came up with. Maybe that can help you move in the right direction. Sorry I couldn't be more helpful.</p>

<hr>

<p><a href="https://en.m.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/image_sequence" rel="nofollow noreferrer">I found the following</a> in a search: </p>

<blockquote>
  <p>You can make a slideshow with crossfading between the pictures, by using a combination of the zoompan and framerate filters. "A" is the duration in seconds how long each picture is shown (without the crossfade duration), and "B" is the crossfade duration in seconds.</p>
</blockquote>

<pre><code>ffmpeg -i IMG_%3d.jpg -vf \
zoompan=d=(A+B)/B:fps=1/B,\ 
framerate=25:interp_start=0:interp_end=255:scene=100 \
-c:v mpeg4 -maxrate 5M -q:v 2 out.mp4
</code></pre>

<p>From the Superuser post you link we find:</p>

<pre><code>-filter_complex \
"[0:v]zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=125,fade=t=out:st=4:d=1[v0]; \
 [1:v]zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=125,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v1]; \
 [2:v]zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=125,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v2]; \
 [3:v]zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=125,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v3]; \
 [v0][v1][v2][v3]concat=n=4:v=1:a=0,format=yuv420p[v]" -map "[v]" -s "800x450" -t 40 ./out_fade.mp4
</code></pre>

<p>Looking at the syntax, it seems you'd just toss it in without the <code>[iN]...[oN]</code> "variables".</p>

<p>So try: </p>

<pre><code>-filter_complex \
"zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=125,fade=t=out:st=4:d=1"
</code></pre>

CC BY-SA 4.0
2019-05-18T16:40:00.367Z
+1 for trying, I am able to make it work using this - ffmpeg -i img%03d.jpeg -i 1.mp3 -vf zoompan=z='zoom+0.002':d=25*5:s=1280x800 -pix_fmt yuv420p -c:v libx264 -t 01:05:00 out12345.mp4  ............. my next job is to add random transition for images, so don't want to keep just 1 effect, add command to your answer I added and I will accept thanks, if you know how to improve it that would be great too
Mathematics
CC BY-SA 4.0
2019-05-18T14:51:35.863Z
2019-05-18T14:51:35.863Z
user3643
<p>How can I add add zoom transition effects using FFmpeg to a variable number of images?</p>

<p>I am able to create video from a variable number of images but I am not sure how to add zoom in and out transition effects between images:</p>

<pre><code> ffmpeg -framerate 1/5 -i img%03d.jpeg -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
</code></pre>

<p>I found this, </p>

<p><a href="https://superuser.com/questions/1189246/ffmpeg-image-slideshow-with-zoompan-and-fade-in-out/1190199">https://superuser.com/questions/1189246/ffmpeg-image-slideshow-with-zoompan-and-fade-in-out/1190199</a></p>

<p>But problem is that images are hard coded in that example and I am not sure how to make it work for a variable number of images?</p>

CC BY-SA 4.0
2019-05-16T18:35:04.457Z
anybody ????????
Mathematics
<ffmpeg>
How to add zoom transition effects using FFmpeg to a variable number of images?
Mathematics
# How to add zoom transition effects using FFmpeg to a variable number of images?

(Asked by: username_0 on 2019-05-13)

How can I add add zoom transition effects using FFmpeg to a variable number of images?
I am able to create video from a variable number of images but I am not sure how to add zoom in and out transition effects between images:
 ffmpeg -framerate 1/5 -i img%03d.jpeg -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4

I found this, 
https://superuser.com/questions/1189246/ffmpeg-image-slideshow-with-zoompan-and-fade-in-out/1190199
But problem is that images are hard coded in that example and I am not sure how to make it work for a variable number of images?

**Tags:** ffmpeg

> **Comments:**
> **username_0**: anybody ????????  

---

## 1 answers

### Answer by username_1 on 2019-05-18. Score: 1

I originally thought I could handle this one, but I'm still new to FFmpeg and don't think I can solve this for you. Below follows what I came up with. Maybe that can help you move in the right direction. Sorry I couldn't be more helpful.

I found the following in a search: 

You can make a slideshow with crossfading between the pictures, by using a combination of the zoompan and framerate filters. "A" is the duration in seconds how long each picture is shown (without the crossfade duration), and "B" is the crossfade duration in seconds.

ffmpeg -i IMG_%3d.jpg -vf \
zoompan=d=(A+B)/B:fps=1/B,\ 
framerate=25:interp_start=0:interp_end=255:scene=100 \
-c:v mpeg4 -maxrate 5M -q:v 2 out.mp4

From the Superuser post you link we find:
-filter_complex \
"[0:v]zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=125,fade=t=out:st=4:d=1[v0]; \
 [1:v]zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=125,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v1]; \
 [2:v]zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=125,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v2]; \
 [3:v]zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=125,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v3]; \
 [v0][v1][v2][v3]concat=n=4:v=1:a=0,format=yuv420p[v]" -map "[v]" -s "800x450" -t 40 ./out_fade.mp4

Looking at the syntax, it seems you'd just toss it in without the [iN]...[oN] "variables".
So try: 
-filter_complex \
"zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=125,fade=t=out:st=4:d=1"

> **Comments:**
> **username_0**: +1 for trying, I am able to make it work using this - ffmpeg -i img%03d.jpeg -i 1.mp3 -vf zoompan=z='zoom+0.002':d=25*5:s=1280x800 -pix_fmt yuv420p -c:v libx264 -t 01:05:00 out12345.mp4  ............. my next job is to add random transition for images, so don't want to keep just 1 effect, add command to your answer I added and I will accept thanks, if you know how to improve it that would be great too  

---

