Jan 25, 2011

Creating Stop Motion (Time Laps) Videos in Ubuntu 10.x

I'm back from Port Au Prince, Haiti. While I there I captured Time Laps photography of our team building a dormitory. Now that I’m back its time to put these photos together into a video. In windows I could use MakeAVI but it has limited encoding codecs and no MPEG4 support. That means no 1080p video output. I want a Linux solution in Ubuntu.

First I tried using mencoder from the command line and found that it didn’t support JPG. This issue I couldn’t immediately fix but was able to convert all my photos to PNG quickly.

MenCoder Links
Timelapse Photography with your spare Ubuntu Box and Digital Camera
How to create a time lapse video with Ubuntu



Photos converted, the above guides allowed me to get video exported but created but with terrible quality. After searching around I found code snippets explaining how to add bitrate settings to my command line.
How-To instructions (for mencoder): At the bottom of the page is a $opt variable setting including vbitrate control. I used only the vbitrate setting and left the rest alone.



Stop Motion
Amid all this work I discovered a GUI package called Stop Motion. It is available in Ubuntu’s application installer and provides a nice front-end. Unfortunately it doesn’t work immediately. 


1. Open Stop Motion and go to Setting -> Configure Stopmotion






























2. Third tab over, select Mencoder for MPEG4. By default, Start Encoder text field, is setup to use JPG which is not supported. I changed all JPG to PNG since my photos were now converted to PNG.



































3. Next delete the $opt and put in vbitrate=15000000. This bitrate number is a complete estimation and based on no calculation.


Start Encoder Field
Before

mencoder -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=1:$opt -mf type=jpg:fps=8 -o "$VIDEOFILE" "mf://$IMAGEPATH/*.jpg"

After
mencoder -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=15000000 -mf type=png:fps=15 -o "$VIDEOFILE" "mf://$IMAGEPATH/*.png"




































4. Now select Apply and Close
With these new settings I'm able to add my .PNG files and export stop motion video with excellent MPEG 4 quality.

No comments: