Creating a light painting form video footage

Rendering point clouds in Blender howto.

Composited light paining in ffmpeg and graphicsmagick

This is a quick howto on creating a light painting from video footage. The example image was created using a robot arm. This howto is for systems running GNU/Linux but should work on other operating systems if the tools are installed correctly.

Camera setup

Setting up the exposure is similar to if you are creating a light painting using a single long exposure. I used a video SLR and set the shutter speed to be as long as possible, for 25 fps this was 1/30s.

Movement

Depending on the effect you are looking for you will have to control the speed of your light. If the light is moving to fast it will result is a sausage effect, where the light path pinches in after every frame. This could be desirable as it illustrates speed in the final image...

Exporting stills from footage

Ensure you have ffmpeg installed. Create a new folder and copy the video file to it. Open a terminal in that directory and run the following command to export the video to stills:

ffmpeg -i <filename.mov>  image-%3d.pnm

You can change pnm to whatever format you like that is supported by both ffmpeg and GraphicsMagick (eg tga, png etc).

Create base image

Ensure GraphicsMagick is installed and in your environment path. Run the following command to create a solid black image:

gm convert -size 1920x1080 xc:black out.pnm

Again adjust resolution and file format to you preference.

Composite frames

Run the following to composite all of the frames using the lighten blend mode:

find . -name "image-*.pnm" -exec gm composite -compose lighten '{}' out.pnm out.pnm \;

Convert output

Convert the final output to a more sane file format:

gm convert out.pnm out.png

Clean up

rm *.pnm