0

I have a folder with 15 images and 1 audio file:

image_1.jpg, image_2.jpg, image_3.jpg ..... and music.webm

(Also resolution of images is 1440x720)

I want to combine these images into a video with audio in background.And framerate I require is 0.2 (5 second for each frame).I gave a search on Stackoverflow and I found the nearest example and tried.But it failed.

ffmpeg -f image2 -i image%03d.jpg -i music.webm output.mp4

(Actually I have very little knowledge of ffmpeg so please excuse my foolishness)

Please help me with my issue.(Also I didn't understood where in the code I have to enter framerate)

Edit:-If needed I can easily tweak with filename of images.Be free to tell me that too

1 Answers1

0

Try this:

ffmpeg -r 0.2 -i image_%02d.jpg -i music.webm -vcodec libx264 -crf 25 -preset veryslow -acodec copy video.mkv

So -r specifies fps (I actually didn't try using a float value there, but try it)

-vcodec specifies video codec, -crf quality, preset the encoding speed (slower is more efficient), -acodec copy says audio should be copied.

I think that should work, give it a try. You will need to rename the images to image_01.jpg image_02...

Also have a look here: How to create a video from images with FFmpeg?

Felixkruemel
  • 98
  • 1
  • 9
  • [Image demuxer](https://ffmpeg.org/ffmpeg-formats.html#image2-1) option is `-framerate`. – llogan Apr 13 '21 at 16:59
  • @llogan I tried it some time ago too, -r for specifying framerate also works as it should (I also would have seen no reason for it not to work). However I didn't try it with float numbers. – Felixkruemel Apr 14 '21 at 16:47