<p>The "solution" that you gave to your own question confuses me because it seems to be somewhat unrelated to your initial question.</p>

<p>What I understood from your question:</p>

<ol>
<li>You have a Sequence of Images in 3 directories.</li>
<li>Make a movie from each Image Sequence.</li>
<li>Length is 1s each.</li>
<li>Overlay an image for each 1s movie.</li>
<li>concatenate the movies -> 3s movie</li>
<li>Loop 3 times -> 9s movie</li>
</ol>

<p>I've added the fllowing to your code in your question:</p>

<ol>
<li>Add <code>-start_number 1</code> before every input</li>
<li>Add <code>loop=loop=2:size=30</code> after <code>concat</code></li>
</ol>

<p>Notice <code>loop=2</code> loops 3 times.</p>

<p>Furthermore it needs a size (the total number of frames to loop over).</p>

<p>This depends on how many images you had.</p>

<p>I had 10 images in the 3 directories. <code>10 x 3 = 30</code></p>

<pre><code>ffmpeg \
-start_number 1 -framerate 12 \
-i "imgSequ1/img-%d.png" \
-start_number 1 -framerate 12 \
-i "imgSequ2/img-%d.png" \
-start_number 1 -framerate 12 \
-i "imgSequ3/img-%d.png" \
-i "overlay1.png" \
-i "overlay2.png" \
-i "overlay3.png" \
-filter_complex "\
[0:v]scale=600x900[scaled1];\
[1:v]scale=600x900[scaled2];\
[2:v]scale=600x900[scaled3];\
[scaled1][3:v]overlay[tmp1];\
[scaled2][4:v]overlay[tmp2];\
[scaled3][5:v]overlay[tmp3];\
[tmp1][tmp2][tmp3]concat=n=3,loop=loop=2:size=30[scaled]" \
-map "[scaled]" -r 10 -vcodec libx264 -pix_fmt yuv420p -crf 23 "result.mp4"
</code></pre>

CC BY-SA 4.0
2020-02-28T17:46:28.593Z
2020-02-28T17:46:28.593Z
drake7
<p>This is the solution and it works.</p>

<p>-start_number 1 -framerate 3/1 
-i DSC%04d_0013.jpg 
-loop 1 -i overlay.png"
-filter_complex "
[0:v]scale=600x900[scaled];
[scaled][1:v]overlay,trim=duration=3,loop=loop=2:size=9[tmp]
" -map [tmp] -r 10 -vcodec libx264  -pix_fmt yuv420p -crf 23 
test.mp4</p>

CC BY-SA 4.0
2020-02-28T02:49:51.327Z
2020-02-28T02:49:51.327Z
Nesan Mano
<p>I am trying to make a video from a bundle of image files and then apply a an overlay on top of it.Another requirement is to make the video loop 3x. It is simply not working.
The requirement is to produce a video of 3 seconds looped 3x. The below script does npt allow to do it.</p>

<p>This is my script.</p>

<pre><code>ffmpeg 
-start_number 1 -framerate 3/1 
-i "C:\Users\xxx\AppData\Local\xxx\xxx\xxx\xxx\xxx\xxx\xxx\963d9d9b8e1\DSC%04d_0013.jpg"

-"C:\Users\xxx\AppData\Local\xxx\xxx\projects\xxx\xxx\xxx\xxx\963d9d9b8e1\DSC%04d_0013.jpg"

-i "C:\Users\xxx\AppData\Local\xxx\xxx\projects\1237\1138\pictures\bundle\963d9d9b8e1\DSC%04d_0013.jpg"

-i "C:\Users\xxx\AppData\Local\xxx\xxx\projects\1237\1138\overlay.png" 
-i "C:\Users\xxx\AppData\Local\xxx\xxx\projects\1237\1138\overlay.png" 
-i "C:\Users\xxx\AppData\Local\xxx\xxx\projects\1237\1138\overlay.png" 
-filter_complex " [0:v]scale=600x900[scaled1]; [1:v]scale=600x900[scaled2]; [2:v]scale=600x900[scaled3]; [scaled1][3:v]overlay[tmp1]; [scaled2][4:v]overlay[tmp2]; [scaled3][5:v]overlay[tmp3]; [tmp1][tmp2][tmp3]concat=n=3[scaled] "
-map [scaled] -r 10 -vcodec libx264  -pix_fmt yuv420p -crf 23  "C:\Users\xxx\Documents\Projets\2020\xxx\video test ffmpeg\test.mp4"
</code></pre>

CC BY-SA 4.0
2020-02-28T02:21:26.217Z
Please specify in details what means your sentence “It is simply not working.”
MarianD
CC BY-SA 4.0
2020-02-29T00:34:20.270Z
Original question was also answered at the crosspost at Stack Overflow: [FFMPEG Video loop from images files](https://stackoverflow.com/a/60441262/1109017), but the quesiton requirements changed after answering.
llogan
<video><ffmpeg>
FFMPEG Video loop from images files
Nesan Mano
# FFMPEG Video loop from images files

(Asked by: username_0 on 2020-02-27)

I am trying to make a video from a bundle of image files and then apply a an overlay on top of it.Another requirement is to make the video loop 3x. It is simply not working.
The requirement is to produce a video of 3 seconds looped 3x. The below script does npt allow to do it.
This is my script.
ffmpeg 
-start_number 1 -framerate 3/1 
-i "C:\Users\xxx\AppData\Local\xxx\xxx\xxx\xxx\xxx\xxx\xxx\963d9d9b8e1\DSC%04d_0013.jpg"

-"C:\Users\xxx\AppData\Local\xxx\xxx\projects\xxx\xxx\xxx\xxx\963d9d9b8e1\DSC%04d_0013.jpg"

-i "C:\Users\xxx\AppData\Local\xxx\xxx\projects\1237\1138\pictures\bundle\963d9d9b8e1\DSC%04d_0013.jpg"

-i "C:\Users\xxx\AppData\Local\xxx\xxx\projects\1237\1138\overlay.png" 
-i "C:\Users\xxx\AppData\Local\xxx\xxx\projects\1237\1138\overlay.png" 
-i "C:\Users\xxx\AppData\Local\xxx\xxx\projects\1237\1138\overlay.png" 
-filter_complex " [0:v]scale=600x900[scaled1]; [1:v]scale=600x900[scaled2]; [2:v]scale=600x900[scaled3]; [scaled1][3:v]overlay[tmp1]; [scaled2][4:v]overlay[tmp2]; [scaled3][5:v]overlay[tmp3]; [tmp1][tmp2][tmp3]concat=n=3[scaled] "
-map [scaled] -r 10 -vcodec libx264  -pix_fmt yuv420p -crf 23  "C:\Users\xxx\Documents\Projets\2020\xxx\video test ffmpeg\test.mp4"

**Tags:** video, ffmpeg

> **Comments:**
> **username_1**: Please specify in details what means your sentence “It is simply not working.”  
> **username_2**: Original question was also answered at the crosspost at Stack Overflow: [FFMPEG Video loop from images files](https://stackoverflow.com/a/60441262/1109017), but the quesiton requirements changed after answering.  

---

## 2 answers

### Answer by username_3 on 2020-02-28. Score: 1

The "solution" that you gave to your own question confuses me because it seems to be somewhat unrelated to your initial question.
What I understood from your question:

You have a Sequence of Images in 3 directories.
Make a movie from each Image Sequence.
Length is 1s each.
Overlay an image for each 1s movie.
concatenate the movies -> 3s movie
Loop 3 times -> 9s movie

I've added the fllowing to your code in your question:

Add -start_number 1 before every input
Add loop=loop=2:size=30 after concat

Notice loop=2 loops 3 times.
Furthermore it needs a size (the total number of frames to loop over).
This depends on how many images you had.
I had 10 images in the 3 directories. 10 x 3 = 30
ffmpeg \
-start_number 1 -framerate 12 \
-i "imgSequ1/img-%d.png" \
-start_number 1 -framerate 12 \
-i "imgSequ2/img-%d.png" \
-start_number 1 -framerate 12 \
-i "imgSequ3/img-%d.png" \
-i "overlay1.png" \
-i "overlay2.png" \
-i "overlay3.png" \
-filter_complex "\
[0:v]scale=600x900[scaled1];\
[1:v]scale=600x900[scaled2];\
[2:v]scale=600x900[scaled3];\
[scaled1][3:v]overlay[tmp1];\
[scaled2][4:v]overlay[tmp2];\
[scaled3][5:v]overlay[tmp3];\
[tmp1][tmp2][tmp3]concat=n=3,loop=loop=2:size=30[scaled]" \
-map "[scaled]" -r 10 -vcodec libx264 -pix_fmt yuv420p -crf 23 "result.mp4"


---

### Answer by username_0 on 2020-02-28. Score: 0

This is the solution and it works.

-start\_number 1 -framerate 3/1
-i DSC%04d\_0013.jpg
-loop 1 -i overlay.png"
-filter\_complex "
[0:v]scale=600x900[scaled];
[scaled][1:v]overlay,trim=duration=3,loop=loop=2:size=9[tmp]
" -map [tmp] -r 10 -vcodec libx264 -pix\_fmt yuv420p -crf 23
test.mp4


---

