Pregnancy Time Lapse

250 days worth of around the clock work to bring a baby into the world summarized into 30 seconds. Notice the growing hair as well as the belly.

To create the video I stitched together 137 images for each orientation. Start by collecting all of your images into a temporary folder and then execute the following bash script:


#! /bin/bash
cd temp # copy time stamped pics into this folder
# rename JPG files sequentially, will also work with *.png
a = 1
for i in *.JPG; do
new=$(printf "%04d.JPG" ${a}) #zero pads new file name with 4 zeros
cp ${i} sequence/${new}              # copy renamed image to folder named sequence
let a=a+1
done
cd sequence
# make movie
# r: frmae rate
ffmpeg -qscale 5 -r 10 -b 9600 -i %04d.JPG movie.mp4

The script copies and renames the images sequentially (0000.JPG, 0001.JPG,…) in preparation to use ffmpeg. Then a move is created at the frame rate specified by the option ‘r’. The move will be output in the sequence folder with the name ‘movie’.

Advertisements

About Ryan

Ryan is currently a National Research Council Postdoctoral Research Fellow at the Air Force Research Laboratory. His research area includes Prognostic Health Management of Electronics. For more information please visit: www.rdlowe.com
This entry was posted in Project and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s