Vals del vampiro animation

⇠ Back to Blog:Hacks
m
m
Line 1: Line 1:
These are the steps we followed to produce the animation of the ''Vals del vampiro''.
+
[[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.
  
We took the pictures from above with the camera <wz tip="(?!)">We tried to control the camera remotely, from wifi or from a cable, but it seems to be broken as all options to do that failed.</wz> mounted on a tripod. As 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.
+
--more--
 +
 
 +
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 <wz tip="We tried to control the camera remotely, from wifi or from a cable, but it seems to be broken as all options to do that failed.">(?!)</wz> 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.
  
 
<center><wz tip="Superpositions of a frame from the beginning with one from the end, showing the drift of the setup and the consequent misalignment.">[[File:Screenshot_20190608_123137.png|400px]]</wz></center>
 
<center><wz tip="Superpositions of a frame from the beginning with one from the end, showing the drift of the setup and the consequent misalignment.">[[File:Screenshot_20190608_123137.png|400px]]</wz></center>
  
This is not too much of an issue as this merely produce a small zoom and the video concludes with an intentional zoom anyway. However, this does not help with the cropping.
+
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, [[Nikon_D5300|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.
 +
 
 +
<center><wz tip="Code to crop the frames, taking into account the unintentional drift of the camera.">[[File:mathematica-crop-vampire.png|600px]]</wz></center>
 +
 
 +
Then, I did some batch re-masterization of the colour, as it was a bit dark. I used Imagemagick's [http://www.fmwconcepts.com/imagemagick/autowhite/index.php autowhite] script:
 +
 
 +
<pre>
 +
for f in cr-*.jpg; do ./autowhite "$f" ""aw-${f%%.*}".jpg"; done
 +
</pre>
 +
 
 +
The cropping was done from the first frame till the last without the manual zoom (DSC_6687.JPG), whose list was put in the 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 a better effect.
 +
 
  
For processing of the frame, first, we resized the pictures, keeping high resolution (2400):
+
Finally, we resized the pictures to turn them into a movie, keeping high resolution (2400):
  
 
<pre>
 
<pre>
Line 13: Line 28:
 
</pre>
 
</pre>
  
Then we removed some frames for synchronization with the song. This was done initially by hand, but once we decided to resize all pictures with a higher resolution (as cropping finally resulted in a poor result), we used the following command from the "removed" folder of the first set to remove the same frames between the two batches:
+
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:
  
 
<pre>
 
<pre>

Revision as of 13:08, 9 June 2019

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.

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.

Mathematica-crop-vampire.png

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

The cropping was done from the first frame till the last without the manual zoom (DSC_6687.JPG), whose list was put in the 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 a better effect.


Finally, we resized the pictures to turn them into a movie, keeping high resolution (2400):

for photo in *.JPG;  do convert $photo -resize 2400 rs-$photo; done

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