How can I combine 30,000 images into a timelapse movie?

69

50

I have taken 30,000 still images that I want to combine into a timelapse movie. I have tried QuickTime Pro, TimeLapse 3, and Windows Movie Maker, but with such a huge amount of images, each of the programs fail (I tried SUPER ©, but couldn't get it to work either...?). It seems that all of these programs crash after a few thousand pictures.

The images I have are all in .JPG format, at a resolution of 1280x800, and I'm looking for a program that can put these images into a timelapse movie in some kind of lossless format (raw/uncompressed AVI would be fine) for further editing. Does anyone have any ideas, or has anyone tried anything like this with a similar number of pictures?

Swift

Posted 2011-02-22T21:10:53.913

Reputation: 801

jpeg is lossy, so you have already lost quality, you can not get it back. – ctrl-alt-delor – 2016-03-02T20:56:12.253

have you tried something like Adobe Premiere, or Final Cut Pro? – Mahmoud Hossam – 2011-02-23T01:00:33.663

Have you tried using a lossless video codec like HuffYUV? – Hydaral – 2011-02-23T05:46:27.070

Answers

54

Avidemux can create movies from a bunch of images. http://fixounet.free.fr/avidemux/

You could also use mencoder, but is a bit harder to use, with all the command line options 'n all. I've been using this:

mencoder mf://*.jpg -mf fps=xxx:type=jpg -ovc x264 -x264encopts bitrate=yyyy:threads=2 -o outputfile.mkv

I use

xxx = 25 and 
yyy = 1200

which produces vids that are just fine. Add tunes to the movie by inserting:

-oac copy -audiofile audiofile.mp3

klokop

Posted 2011-02-22T21:10:53.913

Reputation: 796

2mencoder outputs avi, regardless of output filename. There are options to output other formats, but the code doesn't work well. The recommended way is to output h.264-in-avi, then remux. Just use ffmpeg instead. (see Shenal Silva's answer) – Peter Cordes – 2015-01-15T05:08:16.840

mencoder is less maintained/available than it was in 2011. The equivalent in MPV: mpv mf://*.jpg --mf-fps=25 --ovc libx264 --ovcopts=bitrate=1200:threads=2 -o outputfile.mkv – Sam Brightman – 2015-07-05T07:51:08.730

Avidemux only returns in VLC complaining "VLC does not support audio or video format "PNG ". Unfortunately there is no way for you to fix this." – vallentin – 2016-04-16T10:23:25.833

Sorry, @Vallentin, can't help you there. – klokop – 2016-04-19T08:33:47.923

2Avidemux ROCKS! Quick insert of 33.000 images. Quick save to uncompressed AVI - and it gets automaticly split into 4GB AVI chunks. But all of them are playable! – Swift – 2011-02-23T23:03:51.730

2+1 for Avidemux, I've done tons of video editing using MeGUI, and didn't even know such a good alternative existed! – Breakthrough – 2011-02-25T19:15:39.943

41

Use FFmpeg.

This will create a video slideshow (using video codec libx264) from series of png images, named named img001.png, img002.png, img003.png, …

Each image will have a duration of 5 seconds, change the variable according to your choice.

ffmpeg -f image2 -r 1/5 -i img%03d.png -c:v libx264 -pix_fmt yuv420p out.mp4

If your images have four digits, use %04d, etc. If your images do not have this pattern, you can use shell globs, at least on Linux and OS X:

ffmpeg -f image2 -pattern_type glob -i 'time-lapse-files/*.JPG' …

You can also change the output framerate by specifying another -r after the input.

Shenal Silva

Posted 2011-02-22T21:10:53.913

Reputation: 943

2You can use -framerate for the image2 input format. I would recommend against setting an output fps different from input fps, unless you actually want ffmpeg to drop or duplicate frames. (unless outputting to a container like mkv where ffmpeg supports variable frame rate.) Yeah, just tested, and you do get extra dup frames fed through x264, so just set the FPS of the input, but putting -r or -framerate BEFORE -i .../stuff – Peter Cordes – 2015-01-15T05:04:59.163

2

I would also recommend ffmpeg. I've blogged about this here (more details about the preparation and arguments): http://www.dsebastien.net/2015/01/25/simple-time-lapse-using-ffmpeg/

– dSebastien – 2015-01-25T17:08:43.017

cat *.jpg | ffmpeg -framerate 60 -f image2pipe -i - ~/output.mp4 here is alternative if you don't have -pattern_type glob available – vearutop – 2016-12-16T08:40:52.720

As far as I can tell, FFmpeg has some bugs in the parsing code for wildcards -- but doing some fairly signiifcant filename munging on my part (had to figure out how to get Powershell to emit a counter on a datetime sorted listing pipeline -- psst. the answer is a script level variable.) – Timothy Lee Russell – 2017-06-23T06:32:25.847

8Just a note of warning: do not think you can bypass ffmpeg's printf syntax and just use *.jpg or something for more complex patterns. It will actually overwrite each and every one of your image files with the first one! I tried it myself. – Christian – 2013-01-02T16:34:50.640

I was stuggeling with this as well. I turns out you can do this but need to set the glob style flag.

ffmpeg -pattern_type glob -i 'time-lapse-files/*.JPG' time-lapse.mp4 – arno_v – 2013-12-31T12:25:03.130

12

If you do some basic calculations you'll see that you are probably running out of memory if you are trying to keep the movie uncompressed.

Each frame is 1,024,000 pixels. At 32 bits per pixel that's 32,768,000 bits (4,096,000 bytes or 3.9 MB).

If we multiply that up by 30,000 frames you need 117187.5 MB (114.45 GB) of memory to hold the whole movie in memory in one go - no wonder QuickTime Pro is failing.

You could try reducing the resolution but that might still fail.

You will need to build the movie up in smaller chunks and then stitch the whole thing together. I would expect that there are applications that do this without loading the entire movie into memory. The final movie will also have to be compressed - again as it would occupy 114 GB on the hard drive. A movie only occupies a single DVD after all while your movie is 20 minutes long (at 25 frames per second).

ChrisF

Posted 2011-02-22T21:10:53.913

Reputation: 39 650

4AFAIK, there is no video editing program in the world that stores any uncompressed clip entirely in memory before parsing/saving. – Breakthrough – 2011-02-22T21:40:01.797

@Breakthrough ~ But how do you composite it into a compressed clip? – jcolebrand – 2011-02-22T21:42:27.517

@Breakthrough - that's probably true, but the OP is wanting an uncompressed movie. – ChrisF – 2011-02-22T21:43:29.217

2@ddrachenstern and @ChrisF - there is a difference between immediate storage and long-term storage. There is no video editing program that stores the entire length of the uncompressed video data in memory. Even when you scroll through the preview, it will recreate the data from what it has stored on the hard disk from the various media sources (and maybe a bit more for caching). Other then that, when you finally "render" a project, then you get the full video output (usually as a stream). The full video output can then be saved as-is (e.g. uncompressed/RAW), or streamed to an encoder. – Breakthrough – 2011-02-22T21:56:42.330

@Breakthrough - I understand that - but if the programs work for a few 10s or 100s of images but fail for 1000s then it's likely that something like this is happening. If the OP knows about this possibility then he can either a) try some other approach or b) ask the right question of the software. – ChrisF – 2011-02-22T21:59:52.700

1Sorry, when I made my first comment, I just wanted to point out that the problem is not a lack of memory. I also meant that while a program may store some uncompressed video data in memory (e.g. for previewing), it never stores the entire video stream (again, due to the issues you brought to light in your answer). This is just the way these programs are made, so this shouldn't be an issue. Sorry for any misinterpretations! – Breakthrough – 2011-02-22T22:01:14.477

11

Try PhotoLapse; a review of it is given on Lifehacker.com here.

enter image description here

JYelton

Posted 2011-02-22T21:10:53.913

Reputation: 2 848

The link to Photolapse shows definite signs of rigor mortis. – Timothy Lee Russell – 2017-06-18T06:46:08.300

@Timothy Updated link. – JYelton – 2017-06-18T07:10:04.240

Thanks @JYelton. I ended up stitching them together with FFmpeg but I want to try this one out as well, so I appreciate it. – Timothy Lee Russell – 2017-06-18T08:18:16.220

1

Here is an Video showing this tool in action: http://vimeo.com/1226517

– Darokthar – 2011-02-22T21:29:52.467

I had a typo. I allready tried Photolapse, but it fails in the rendering process. If I lower to 10.000 images, it completes the AVI file - but the file is useless, and cannot be played. – Swift – 2011-02-23T22:06:27.063

@Swift I understand you need the files to be at their original size. I've always batch downsampled images using Irfanview prior to creating the timelapse avi. Hopefully you find the solution you need! – JYelton – 2011-02-23T22:14:01.847

11

Yes, I know that this thread is over a year old. I've been using this for over 2 years though, and it works great with 10,000+ images:

1080p@24fps, no sound

ls -1v | grep JPG > files.txt
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=21600000 -o windowsill_flowers_7.avi -mf type=jpeg:fps=24 mf://@files.txt -vf scale=1920:1080

4k@90fps, no sound

ls -1v | grep JPG > files.txt
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=21600000 -o windowsill_flowers_7.avi -mf type=jpeg:fps=90 mf://@files.txt -vf scale=3840:2160

I had to mess around with the codec a lot before getting something that youtube would recognize, though. An sample using the 2nd block can be found here: http://www.youtube.com/watch?v=4G_aaPG2QWk

mrlitsta

Posted 2011-02-22T21:10:53.913

Reputation: 231

8

I use Google's Picasa. It's also a very good photo organizer in my opinion. Here is how.

  1. File > Add Folder to Picasa... > add the folder with your photos.
  2. Right click your added folder in the left 'Folders' menu and > Select All Pictures
  3. From the top menu > Create > Video > From Selection...
  4. Now you're in the video maker > Video Tab > Transition Style > Time Lapse
  5. You can Load an Audio Track, change the dimensions (I normally use 1024x768), add slides with text ini the Slide Tab...
  6. Video Maker > Video Tab > Create Video. You can sign in with you google account and upload it to youtube from here too.

Back in the library, you can right click the video > locate in disk to see where the video was saved. Another good thing about using Picasa is that you can select all the pictures and go to the top menu Picture > Batch Edit > I'm Feeling Lucky. It will correct the contrast and colour of all the photos at the same time.

Before you create the video, you may want to add some movement to your time lapse with http://motiontimelapser.co.nr/

Disclamer: I'm the author.

Katu

Posted 2011-02-22T21:10:53.913

Reputation: 181

This worked really well for me with about 2500 images taken with a GoPro in burst mode. If you already use Picasa check this solution out. – lonstar – 2015-05-31T16:59:41.913

Picasa has been set out to pasture. – Timothy Lee Russell – 2017-06-18T06:48:34.677

5

I faced a similar problem a while ago when I tried making a timelapse for a create-a-thon at a local hackerspace. I run OS X, so I'm not sure how viable it is to use this on Windows, but I used MEncoder.

This is the command I used in terminal:

mencoder mf://*.jpg -mf w=800:h=600:fps=5:type=jpg -ovc copy -oac copy -o buildmadison.avi

There's two problems with this:

  1. It's AVI.
  2. All it does is slosh the images together into a single file with no compression. Of course, it's fast as heck, and it actually works!

Afterwards I ran it through another utility to convert it to a halfway decent format.

MEncoder is part of the MPlayer project, located here: http://www.mplayerhq.hu/

wjl

Posted 2011-02-22T21:10:53.913

Reputation: 295

4

I see this thread is kind of old, but I found that MakeAVI is the best program for me!

You can download it here: http://sourceforge.net/projects/makeavi/?source=dlp

  • All you have to do is download it, and run the executable inside the downloaded folder (no installer).
  • Then to add the pictures, you just push the "Add Files" button in the top right corner and select the pictures you want to compile.
  • Once they have been imported, you can use the "Up" and the "Down", on the middle left side, to adjust the ordering of the pictures in case they didn't stay in order.
  • Then to adjust the frame rate of the compiled pictures, you can change the text box inside the "Playback frame rate" frame, lower right side, to the frame rate you want.
  • Since the program is still in beta (0.1.1), some things don't work. Push the "Begin" button and specify the file name you want. When it asks what type of compression you want, select the one you want, except for the "Full Frames(Uncompressed)" which didn't work for me.
  • Then once it's done compiling the video, go and watch to video and see how it is. If the video is blank(no length), try changing the Compression options. (That's what happened when I tried "Full Frames(Uncompressed)")

I couldn't get any of the other methods listed here to work, and this one worked for me! Hope it works for you! :)

Jyclop

Posted 2011-02-22T21:10:53.913

Reputation: 41

3

Have you tried VirtualDub?

When you open an image in virtualdub it will ask to load the whole sequence. From there - adjust the frame rate, add some filters (crop, sharpen), choose an encoder, and save your video.

I suggest you experiment at first with a lower number of images, and, if you are pleased with the result, do the whole batch.

Edit: Here is a simple tutorial on this. All you have to do is find a suitable lossless codec, like this one: MSU Lossless Video Codec.

Mike Moe

Posted 2011-02-22T21:10:53.913

Reputation: 131

2

​We tested our Time-Lapse Tool software to generate video from 100k images and it works like a charm. All these images can be added from multiple folders which is helpful for photos from DSLR grouped by 10k images in folder.​

AiDevs

Posted 2011-02-22T21:10:53.913

Reputation: 21

2

If you're using Premiere Pro, just put the images in a dedicated folder, make sure they're numbered in sequence and consecutively, then in Premiere Pro right-click the Project window and choose "Import", select the first image, and check the checkbox "Image Sequence". It will automatically pull all the images in as a sequence called thefirstimageName.jpg but with an image "stack" icon. That's it, sort of. Drag it into a Sequence, then render it out (Export -> Media) as 1080p and then import the export as a new video clip. I do recommend exporting it and re-importing it as a clip because Premiere Pro and Media Encoder can be known to get crashy with hi-res footage if you tinker with cuts and speed changes, so exporting out the hi-res footage to 1080p, while compromising quality, restores stability.

stimpy77

Posted 2011-02-22T21:10:53.913

Reputation: 239

1

I had to do something like that before. I was successfully able to do it in quicktime pro by doing it 500 frames at a time. I would save those as an individual movie and then move on to the next. Then later I would combine all of the 500 frame segments into the final thing.

a sandwhich

Posted 2011-02-22T21:10:53.913

Reputation: 487

Kind of a ripoff for at "professional" piece of software! – Swift – 2011-02-23T22:08:43.333

1

Just for fun, here's another way (no, I'm clearly NOT trying to refine my own process.) It turns out nothing on Windows wants to edit the output mencoder produces from my other answer. This is a more edit-friendly version using ffmpeg:

1080p@90fps, no sound, IMG_00000.JPG - IMG_99999.JPG
    ffmpeg -r 90 -i IMG_%05d.JPG -vcodec libx264 -vpre medium -crf 22 -threads 0 -vf scale=1920:-1 -r 15 -metadata title="foo"

mrlitsta

Posted 2011-02-22T21:10:53.913

Reputation: 231

0

I'd also vote for Virtualdub(have done actually this operation, can't remember if were these many). Is also easy later on to remove frames you don't want, etc. Maybe you could try using a lossless video format to render and store it, like camstudio codec. For a timelapse...maybe is also ok techsmith codec (TSCC), but that works only if you have purchased (or obtained an old version from a magazine) Camtasia, as it installs the encoding version of the codec. It makes really small videos. And probably is apropiate for a time lapse.

S.gfx

Posted 2011-02-22T21:10:53.913

Reputation: 1 643

0

Another program you can use is Time Lapse MovieMonkey

It did the job of creating my latest time lapse movie really really really fast. And I didn't have to read the instructions. It's simple and intuitive, but has enough advanced settings. And it's free.

The author says it's been tested with 50.000 pictures.

user360174

Posted 2011-02-22T21:10:53.913

Reputation: 1

The link has deceased. – Timothy Lee Russell – 2017-06-18T06:49:34.727

0

I get really good results from using Picasa or GoPro-studio.

I'm busy with a video to journal me building a surfboard using these tools. A work in progress have been posted on my profile to YouTube (search for "Surfbordbou" - I'm not allowed more than 2 links per post yet)

Picasa's movie maker is really easy to use, it's 2 clicks and you've got your timelapse of a set of selected pictures.

Spastika

Posted 2011-02-22T21:10:53.913

Reputation: 1

Welcome to the site. When you say you're getting good results, is that doing the same kind of task and working with a quantity of images on the order of magnitude as in the question? That's a key point and you should discuss it in your answer. If the answer is yes, describe it and you have a winning answer. If it's not, it's useful information but not a great answer to this question. In that case, delete this answer, ask a new question about doing your task, and then answer your own question with your solution. That would be another winning combination. – fixer1234 – 2014-11-03T04:52:25.553