3

I am trying to generate video from images using ffmpeg concat demuxer.I am creating a text file with image file path. Since images can be of different duration, i am using duration filter to specify the duration of each image. Sample text file is like :

file 1.jpg

duration 3

file 2.jpg

duration 3

file 3.jpg

duration 5

1.jpg and 2.jpg both are displayed for specified 3 sec each but 3.jpg comes for just 2 seconds.

FFMPEG command:

ffmpeg -f concat -i D:/textfile.txt -y -r 10 -crf 22 -threads 2 -preset veryfast D:/video.mp4

Share a link to this question
CC BY-SA 3.0
2
  • The duration directive doesn't work for the last entry, so add a single frame at the end i.e.file 3.jpg
    – Gyan
    Oct 26, 2017 at 10:56
  • i added file 3.jpg at end. total video duration came as 13 seconds. 3.jpg was there for 7 seconds instead of desired 5
    – hack
    Oct 26, 2017 at 11:06

1 Answer 1

2

Use

ffmpeg -f concat -i textfile -y -vf fps=10 -crf 22 -threads 2 -preset veryfast video.mp4

where textfile is

file 1.jpg
duration 3
file 2.jpg
duration 3
file 3.jpg
duration 5
file 3.jpg
Share a link to this answer
CC BY-SA 3.0
3

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.