Vals del vampiro animation

⇠ Back to Blog:Hacks

Carlos Sánchez, who has all the talents, composed a song (El Vals del vampiro), for which Elena, in a sequence of events that I did not follow in details, came to compose the lyrics. They decided to make a stop-motion animation to release the piece on YouTube. At this point, I got involved for the minor technical aspects of assembling the artwork (also from Elena) into the said animation. These are the steps I followed to do so, which I store here mainly for my own recollection.

The artwork consists of watercolour painting for the background and separate images for the vampire and its victim. We (Elena and myself) then proceeded to capture each frame from above, with the camera. We found it difficult to place the characters without significant fluctuations, even when taking marks. Stabilizing the camera was another issue (?!) and despite it was mounted on a good tripod, since it took a few hours to capture all the frames, the small drift of the setup resulted in a quite significant change of the size of the images between the beginning and the end.

Screenshot 20190608 123137.png

This is not too much of an issue as this merely produce a small zoom and the video concludes with an intentional zoom anyway. Besides, the zooming plugin of kdenlive turned-out to significantly alter the quality of the images, so we had to crop the frames externally, which allowed us to correct for the drift.

I used imagemagick for that, choosing the 4/3 aspect ratio which was that of the pictures. Unfortunately, our camera shoots in 3/2, so the part I had to do manually resulted to be slightly more than anticipated (see below). The automatic part I did by interpolating the size from the first frame to the last before the intentional zoom, to correct for the drift. This was most quickly done with Mathematica:


This indeed corrected for the drift, as shown in these two comparisons overlaying the vampire from the beginning and the end of the animation with (left) and without (right) correction.


Then, I did some batch re-masterization of the colour, as it was a bit dark. I used Imagemagick's autowhite script.

for f in cr-*.jpg; do ./autowhite "$f" ""aw-${f%%.*}".jpg"; done

Processing the cropped or full image did turn out to make no significant difference, as shown below.


The automatic cropping was done from the first frame till the last without the manual zoom (DSC_6687.JPG), for a total of 205 frames, whose list was stored in a file processed by Mathematica. The frames where the manual zoom kicked in, I had to crop by hand since the boundaries then changed rather wildly. I initially thought this I had to do for only the few frames before the full image was captured but then the aspect ratio was wrong. This allowed me however to exaggerate the zoom beyond that allowed by the camera (digital zoom), which makes for a better effect, as seen from the snapshots above from the 1st, middle and last frames of the animation (actually the middle—yellow—frame turns out to be one of those that we removed for synchronization):

Finally, one can also resize the pictures before turning them into a movie, keeping high resolution (2400), although this proved not necessary (in the old times, mencoder would crash on big input files):

for photo in aw-cr-*.jpg;  do convert $photo -resize 2400 rs-$photo; done

As I said, we had to remove some frames for proper synchronization with the song. This was done initially by hand, but for subsequent processing, we used the following command from the "removed" folder of the first set to remove the same frames between the subsequent batches:

ls -1 | xargs -i mv ../../frames-2nd-attempt/{} ../../frames-2nd-attempt/removed

The encoding was done at the frequency of the song's beat, provided by Carlos:

mencoder "mf://rs-*.jpg" -mf fps=2.33334 -ovc lavc -o ./vals1.avi

And the actual rate turned out to be 215 frames in 91.8s, so 2.3402fps. Hopefully, close enough. The song is full of things to notice: "la nota final", the red blushing at the first evocation of blood, plus other tricks that I did not consign in this memorandum since we'll probably never use them again (such as the vampire transforming into its pure shadow).

The final editing was done with kdenlive, which requires no instructions.