What is the difference between these 2 FFMPEG commands?

I am trying to take 5 static images named (1,2,3,4 and 5.jpg) and turn them in a 25 second video with each image being 5 seconds long.

ffmpeg -y -r 25 -loop 1 -t 5 -i 1.jpg -s 1080x1920 video1.mp4
ffmpeg -y -r 25 -loop 1 -t 5 -i 2.jpg -s 1080x1920 video2.mp4
ffmpeg -y -r 25 -loop 1 -t 5 -i 3.jpg -s 1080x1920 video3.mp4
ffmpeg -y -r 25 -loop 1 -t 5 -i 4.jpg -s 1080x1920 video4.mp4
ffmpeg -y -r 25 -loop 1 -t 5 -i 5.jpg -s 1080x1920 video5.mp4
ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4
(where files is the list of video1-5.mp4)

vs

ffmpeg -y -r 25 -loop 1 -t 5 -i %d.jpg -s 1080x1920 video.mp4 

The second command took so long, I got bored of waiting for it to complete, but the first command completes in seconds. There are no additional files with would match %d.jpg so it cant be bringing extra files in.

In my head, these commands do the same thing so its likely a lack of understanding.
Is it that the second command is reencoding when it comes to joining the videos which is taking a long time?

Thanks!

Read more here: Source link