HOWTO+-+Create+HD+Time+Lapse+Video+from+Photographs

Find the latest version here: http://ubuntuforums.org/showthread.php?t=2022316

Run the following commands to sort the images by capture date/time and store them in a new folder called "renamed". This is useful if your camera starts counting from 0001 after reached the highest possible number (e.g. DSC_9999.jpg). code format="bash" cd source_folder_of_pictures mkdir renamed counter=1 ls -1tr *.jpg | while read filename; do cp $filename renamed/$(printf %05d $counter)_$filename; ((counter++)); done cd renamed code

Resize the images first to 1920x1080 for Full HD or 3840x2160 if you need 4K output. All the rest of the operations will be much much faster if you work on smaller images. If you want to keep the initial aspect ratio, remove the exclamation mark after the resolution (1920x1080) in the mogrify command. code format="bash" mkdir resized mogrify -path resized -resize 1920x1080! *.jpg cd resized code
 * 1) Or use parallel to and gm mogrify for a much faster multi core resize
 * 2) parallel --progress gm mogrify -quality 100 -output-directory resized -resize 1920x1080! ::: *.JPG

Use ffmpeg to combine all of the photos in one video without losing quality! WARNING : This will create a huge file as it will only put all of the JPG files together in a single uncompressed video. Use ONLY one of the following three commands. code format="bash" ffmpeg -r 25 -pattern_type glob -i '*.jpg' -c:v copy test.avi # Change -r 25 to define the frame rate. 25 here means 25 fps. ffmpeg -r 25 -pattern_type glob -i '*.jpg' -c:v mjpeg -q:v 2 test.avi # -q:v can get a value between 2-31. 2 is best quality and bigger size, 31 is worst quality and least size) ffmpeg -r 25 -pattern_type glob -i '*.jpg' -c:v ljpeg test.avi # Lossless jpeg resulting in a huuuuuuuge file. Even larger in size than the sum of all of the input pictures together in the case of jpg images. code
 * 1) Alternative commands, but your jpeg images will be recompressed (maybe you want to use one of these if you have png or any other kind of images, or you want a smaller sized video)

Optional step: Load the test.avi file in kdenlive if you want to make any post processing (add audio or any fade in/out video effects etc), but remember to export in a lossless quality format.

Use ffmpeg to compress the video into a High Definition one. code format="bash" ffmpeg -i test.avi -c:v libx264 -preset slow -crf 15 output-final.mkv code Check here for more encoding options: https://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide