[FFMPEG] How to infinitely loop pictures on a video file?

Hey guys!

So I already figured out the command to create a Youtube video from 1x .WAV and 6x. JPEGs:

$ ffmpeg -r 1/6 -f image2 -start_number 1 -i img%03d.jpg -i mywav -vf scale=1280:1024 out.mp4

But because the lenght of the audio is longer than the lenght of the 6 picture displayed the last/6th picture remains on the screen longer than the other and it remains until the end of the .mp4.

Hence, does anybody knows how to:

  1. Make sure that each picture is only displayed once but all on equal time during a video creation using my previous command line?
  2. Loop infinitely? I have seen "-loop 1" switches being added but it seems that "-loop 9" will not loop 9 times.

At the end of the day you've probably guessed that I am trying to have, for example, a 3 minutes video that would have 6 pictures, each displayed 10 seconds (for total 1 minute) and repeat that thrice to fit the video lenght.

After spending MUCH time searching online (my research .TXT is now well over 70 lines...), I am now taking a chance posting this question here just in case...

Thanks in advance,

1 Like