I do what I can

Random thoughts from Mauricio Teixeira…

Tilt-shift video using Bash

leave a comment »

I like to play with tilt-shift videos every once in a while, and usually it needs very complex tools to make. So this time I decided to use the simplest tool ever: a Bash script.

You can see the final result here. Continue reading to know how I did it:

Oh, by the way, this is a very nerdy way of doing it. Not a 1-2-3 method. I did this while bored, but didn’t worry about details. Sorry.

Honestly, I’m using a series of pictures to create a video. In this case I used the Time Lapse application on my Nokia N900. I took a total of 644 shots, one every second.

With all the shots ready, I Google around a little bit, found this interesting web site with very useful hints, and created the following Bash script: tilt_shift_video.sh

The Time Lapse application creates a series of files named FileX.jpg, where X is a number from 0 to the number of pics you have taken. So if you want to use the same script, but did not use the same application to take the pictures, you need to edit the script to suit your file naming (or rename your files).

The tilt-shift effect is actually a blur mask applied to all of the pictures, like this:

So if you want to use the same script, but you want to blur a different position on the picture, you need to edit line 12, and modify the parameters for “sparse-color“. Of course there are a number of other options you can change, so you might want to read the docs to understand.

After the script finishes processing all of the pictures, it will then finally compose all of them together to form the video.

Well, I hope this is somewhat useful for anyone.

If you have any hints, please share on the comments.

Written by netmask

julho 2, 2011 às 17:10

Publicado em Uncategorized

Tagged with , , , ,

Deixe uma resposta

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s

%d blogueiros gostam disto: