简体   繁体   中英

ffmpeg - slideshow from set of images ignoring first image

I can create slideshow with below command

ffmpeg -y -f image2 -r 1/15 -i image%d.jpeg -y -r 45 video.mp4

Video is created successfully ,, but its ignoring the 1st image..

for example in current folder i have

image1.jpeg
image2.jpeg
image3.jpeg

but slide show is created with image2.jpeg and image3.jpeg only..(ie 30 second video with 2 image is created..but i expected 45 second video with 3 images displaying 15 sec per image)

What's wrong with your command is the -r 45 as an output option. You're telling ffmpeg to produce a video with 45 fps output rate. You probably don't want that.

Use the fps filter to set the framerate:

ffmpeg -r 1/15 -i img%d.jpeg -vf fps=25 output.mp4

If you use

ffmpeg -r 1/15 -i img%d.jpeg output.mp4

you will get a video with ~0.07 fps, and three frames, meaning a roughly 45 second long video ( 3 / 0.07 ). This gives the expected result, but it might not be playable in all players.

Note:

  • -y is not needed twice. Only supply it once before -i .
  • -f image2 is not needed.

Using -r as an output option to force another frame rate skips the first frame immediately in some players. I consider this a bug, which is now reported in this ticket .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM