Monday, September 10, 2012

Timelapse: Paris, France - Segovia, Spain

EDIT: Hint: If you just want to see the video, skip to the bottom of this post.

The bad quality of my posts about Japan is a very good example of why I shouldn't try to do anything creative at night after long trips. Still, I couldn't resist browsing through the pictures we took during our trip for the timelapse video tonight (after a 6 hour long drive). And of course, after looking at the pictures, I wasn't going to go to bed. I ended up making the entire video between 2:00 and 4:30 (AM).

First things first, here's our setup (if you didn't read the last posts, i'm currently on a road trip with my brother):
We used a small 720p Webcam, which we attached to the car using our extensive mechanical engineering knowledge and duct tape.

On the software side, we were running a small program named fswebcam on linux. If anyone is interested, here's the bash script I wrote so I didn't have to type in everything every time I wanted to start recording:

 #!/bin/bash  
 FOLDER=timelapse3s  
 if [ $# -ne 1 ]; then  
     echo "Usage: $0 <video device>"  
 else  
     if [ ! -d $FOLDER ]; then  
         mkdir $FOLDER  
     fi  
     fswebcam --no-banner --jpeg 95 --loop 3 -S 6 -r 1280x720 -d $1 $FOLDER/timelapse-%Y%m%d-%H%M%S.jpg  
 fi  

I cut the video with kdenlive. It can import a bunch of images as a video natively, but it's not very efficient at it, an my netbook is not that powerful, so I decided to merge all the images into a video first and then just edit that with kdenlive. To do that (without losing quality) you can use ffmpeg and select mjpeg as the video codec:

ffmpeg -f image2 -r 8 -i %d.jpg -vcodec mjpeg video.mp4 

I don't remember where I got this from, but it works. Your files have to be renamed first, so that ffmpeg finds them using the format string passed in the -i parameter. I also made a script for that:

 #!/bin/bash  
 if [ $# -ne 2 ]||[ ! -d $1 ]||[ -e $2 ]; then  
     echo "Usage: $0 <input_dir> <output_dir>"  
     echo " <output_dir> must not exist"  
 else  
     mkdir "$2"  
     COUNTER=0  
     for file in $(ls "$1")  
     do 
         cp "$1/$file" "$2/$COUNTER.jpg"  
         COUNTER=$(($COUNTER+1))  
     done  
 fi  
 

So, without further ado, here's the video. I hope you like it!


In case you don't like the embedded player, click here

PS: Here's where I got the music from: http://www.jamendo.com/en/artist/4402/outsider

1 comment:

  1. Hallo, da du noch keine neuen Kommentare hast wollte ich mal den Anfang machen :D
    Dann schreiben ja vielleicht auch mal andere Leute :)
    Es freut mich sehr, dass du deinen Blog 'wiedergefunden' hast. Bleib dabei!
    Bussi
    Cocktail :D

    ReplyDelete