Creating time lapse videos with mencoder

In the last post I wrote about the intervalometer I was using to create time lapse videos but I forgot to share how I’m making these videos from the camera files.

There are lots of tools you can use for mounting a time lapse, like Adobe Premiere or Final Cut, but there is also some more simple yet effective ways to do so, using the open source mencoder utility.

The first you will need is to create a text file with all the filenames for the photos you want to use as frames. On a linux box you can use ls -1tr > frames.txt (warning: the first parameter is a “one” not a “l”). This will create a file frames.txt with all files on the current directory, one per line, ordered by date taken. We will use this file to tell mencoder which files to use to create the video.

Next thing is to execute mencoder to create the video.

$ mencoder -nosound -ovc lavc -lavcopts \
vcodec=mpeg4:mbd=2:trell:autoaspect:vqscale=3 \
-vf scale=1920:1080 -mf type=jpeg:fps=20 \
mf://@frames.txt -o time-lapse.avi

With this command we are asking mencoder to pick all the photos from frames.txt and make a full HD video from them at 20 frames per second, you can adjust the fps or the quality of the video by modifying the fps and vqscale parameters respectively.

Here you can see a demo created as explained above, these are me and a friend doing some clean up in my bedroom after doing some work.

Comments

  1. Mirate estos time lapses, tan muy chulos 😛

    Comment by Nym -
    • Mi interés por los time lapses empezó con esos vídeos, el dolly que estoy construyendo es una réplica del que se uso para hacerlos.

      Comment by Hugo Chinchilla -
  2. Pos te echo una mano quiero hacer algo así, si hace falta me prostituyo! xD

    Comment by Nym -
  3. isnt it 1920×1080?

    Comment by fredrik normann -
  4. it should also be “ls -tr > frames.txt” -l gives to much info

    Comment by fredrik normann -
    • Note it is a “one”, not a l.

      And you’re right it is 1920×1080, fixed it. Thanks for the feedback 😉

      Comment by Hugo Chinchilla -
  5. ls -1v if your using these frames for example) 1.jpg 2.jpg 3.jpg …

    Comment by James -
    • ls -1vr my mistake.

      Comment by James -
  6. Pingback: Time-lapsing básico con Linux y una webcam | El Universo de Rgalarcia

  7. Thanks a ton Hugo, you just saved me a bunch of time researching the right mencoder settings to do this! 🙂

    Comment by Rob Young -
  8. Pingback: 2 Months, 1,800 Photos, 2 Minutes | The Viscous Mirror

Leave a Reply

Your email address will not be published. Required fields are marked *