User Tools

Site Tools


createtimelapsvideo

Create a timelapse video from JPGs

If you probably use your RaspberryPi together with the Camera module or an USB cam you might have taken a lot of pics in a static position. If you consider to put all these pictures into a film, it's pretty easy to do so, as long as you have a linux system available. All the following steps are executed and tested on my Ubuntu (14.04) desktop system, but I would guess, they would run on the RaspberryPi, too - but probably take a little longer.

Prerequisites

What you need is a set of pictures. The more you have, the more flexible you are in creating the videos. In addition a Linux OS is needed, where all the scripts could be run.

Prepare tools:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mencoder


Create timelapse video

First prepare a list of all chosen pics:

ls *.jpg > pictures.txt

This list can be put into an mencoder command. Video can be seperated in 16:9 and 4:3 screen size. Playing a litte with framerate (fps=xx) will influence speed and therefore length of the video and depends on kind and amount of pics, just play a litte around, but you can start here:

Size 16:9

mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -vf scale=1920:1080 -o cam.avi -mf type=jpeg:fps=24 mf://@pictures.txt

Size 4:3

mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=4/3:vbitrate=8000000 -vf scale=1920:1440 -o cam.avi -mf type=jpeg:fps=24 mf://@pictures.txt

Audio: If needed, you can also add following params to add some audio to the created video:

-oac copy -audiofile someaudiofile.mp3

I prefer not adding any sound on my own, because if final video is uploaded to youtube, it's way easier to add some legal song to the video by using googles online video studio.

Example result

I made some experiments with my RaspberryPi Livecam, as it could be seen on Nörrmark.de. Here are my final youtube results:

One week:



One year:

createtimelapsvideo.txt · Last modified: 24.08.2014 12:22 by andreas