0

What I'm doing:

I'm still working on my slideshow script. Meaning, I use ffmpeg's concat demuxer (files.txt) to provide ffmpeg with a bunch of .jpg files for a slideshow.

In the past I wanted all images to be shown for 3 seconds each, so I used (misused?) ffmpeg's framerate flag -r 1/3 to achieve said duration, which worked out perfectly and really fast (roughly 10 seconds for all 600 images).

What I want to do now:

Now, I wanted the slideshow to be more dynamic by varying the duration (longer for more interesting ones and so on, you know). So, I decided to ditch the framerate flag and set the duration 3 right in the concat file. Of course, for each file with the correct number of seconds. Which works - kind of.

My only problem is: Now it takes ages for ffmpeg to run through that script. Not only by a little, but it takes about 30 times as long. Even though i already use -c:v libx264 -preset ultrafast.

So, it's no longer really practical to use. Do I miss something or is there a third method?

Edit:

Just noticed ffmpeg drops this warning: More than 1000 frames duplicated. Which can't be the case, when a static image is shown for a maximum of 5 seconds at 25 fps (default value).

Kind regards!

5
  • Try with fewer images and check the resulting video’s framerate. It may be too high.
    – Daniel B
    Jul 10, 2018 at 14:33
  • What is the smallest duration that you use?
    – Gyan
    Jul 10, 2018 at 14:44
  • @DanielB I only tested it with about 30 files and that took about 20 seconds. So I didn't threw all 600 files at ffmpeg, yet.
    – Max M.
    Jul 10, 2018 at 15:05
  • @Gyan Minimum 2 seconds, maximum 5 seconds. No decimal or <1 second.
    – Max M.
    Jul 10, 2018 at 15:06
  • 25 fps is 75 times 0.33 fps. So the warning is neither unwarranted nor surprising. Try 1 fps.
    – Daniel B
    Jul 10, 2018 at 15:52

1 Answer 1

1

When you use the duration directive in a concat demuxer file, what you're setting is the timestamp offset applied to the next file, relative to the starting timestamp calculated for the current file. In order for this to work, input -r can't be used. Which in turn means that each image is assigned the default framerate of 25 fps. At this time, this can't be changed. However, you can reduce framerate. Since you have no fractional seconds, you can reduce to 1 fps.

ffmpeg -f concat -i list.txt -vf fps=1 out.mp4

I've omitted any encoding options. Use ffmpeg 4.0 or later.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.