from a trail camera we have many JPG files, that was shot in every 5 mins about a construction.

We have Ubuntu + Win10 desktops.

What should we use to convert the JPG files to different FPS videos? Ex.: few frames per sec, isn't an issue that it is not 24/sec.

Q: Any solution can come handy, but which is recommended? (ex.: maybe preferred free/legal softwares and on Ubuntu!)

1 Answer 1


FFmpeg can do that (free, open source, cross-platform, has official Ubuntu packages). Assuming you have a folder full of JPG files named like "img043251.jpg", "img043252.jpg" and so on, something like this would convert them into a video:

ffmpeg -framerate 60 -i img%06d.jpg output_video.mp4

where %06d means the file name ends with 6 digits, change it to %04d is there are only 4 digits, etc. Set the framerate as low as you like. Can do many more things with it (crop, rotate and other image operations, overlay text or additional images, add sound tracks, etc.)

MoviePy is a Python module for video editing, it uses the same FFMpeg, among other things. IIRC, Python is installed by default in Ubuntu, installing MoviePy would take a second with pip install moviepy. A MoviePy version of the above command line would be something like this:

from glob import glob
from moviepy.editor import *

files = glob("*.jpg")
frames = [ImageClip(f, duration = 0.5) for f in files]
clip = concatenate_videoclips(frames, method = "compose")
clip.write_videofile("video.mp4", fps = 2)

Looks way more verbose for something as simple as converting a set of files into a video, but for more complex cases it might become more manageable than a long long long command line.

  • I can recommend the use of MoviePy (zulko.github.io/moviepy) as a front end for FFMPEG that makes this sort of thing a lot easier & more user friendly. Jul 31, 2019 at 5:26
  • @Steve Barnes I wouldn't call it "more user friendly". Well, maybe "more Python programmer friendly", but even then it's probably an overkill for something as trivial as converting a set of jpegs into a video. It may worth it if you need some non-trivial processing or complicated visual effects, though.
    – Headcrab
    Jul 31, 2019 at 6:00
  • If you call non-trivial processing adding a title page and a separator frame for each day or traversing sub-directories then yes. I also find the naming and the information available in the function helps a lot friendlier than the FFMPEG helps & manuals. Jul 31, 2019 at 20:17
  • 1
    OK, added a MoviePy example, let the reader judge for themselves.
    – Headcrab
    Aug 1, 2019 at 3:59
  • Nice example, where it scores of course is getting it to recurse sub-directories is a simple change to the glob call and still cross platform. The same with direct use of FFMPEG tends to involve find and pipes IIRC and is not so platform independent. Aug 3, 2019 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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