I do what I can

Random thoughts from Mauricio Teixeira…

Tilt-shift video using Bash

fazer um comentário »

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.

Escrito por netmask

julho 2, 2011 às 17:10

Publicado em Uncategorized

Etiquetado com , , , ,

Deixe uma resposta

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

WordPress.com Logo

You are commenting using your WordPress.com account. Sair / Alterar )

Imagem do Twitter

You are commenting using your Twitter account. Sair / Alterar )

Foto do Facebook

You are commenting using your Facebook account. Sair / Alterar )

Connecting to %s

Seguir

Obtenha todo post novo entregue na sua caixa de entrada.

Join 177 other followers