Vals del vampiro animation

⇠ Back to Blog:Hacks
(Steps for producing the Vals del vampiro animation.)
m
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
[[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.
+
[[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.
  
 
--more--
 
--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.
+
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 this option seems to be broken as all our attempts 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>
Line 9: Line 9:
 
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.  
 
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.
+
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. This was most quickly done with [[Mathematica]]:
  
 
<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>
 
<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>
Line 24: Line 24:
  
 
Processing the cropped or full image did turn out to make no significant difference, as shown below.
 
Processing the cropped or full image did turn out to make no significant difference, as shown below.
 
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, as seen from the snapshots below from the 1st, middle and last frames of the animation (actually the middle, yellow, frame turns out to be one of those we removed for synchronization):
 
  
 
<center><wz tip="Raw frames (left), autowhited (center), cropped then autowhited (final frames, right).">[[File:frames-vampiro-full-cropped-processed.png|400px]]</wz></center>
 
<center><wz tip="Raw frames (left), autowhited (center), cropped then autowhited (final frames, right).">[[File:frames-vampiro-full-cropped-processed.png|400px]]</wz></center>
  
Finally, one can also resize the pictures before turning them into a movie, keeping high resolution (2400):
+
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&mdash;yellow&mdash;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):
  
 
<pre>
 
<pre>
Line 35: Line 35:
 
</pre>
 
</pre>
  
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:
+
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:
  
 
<pre>
 
<pre>
Line 46: Line 46:
 
mencoder "mf://rs-*.jpg" -mf fps=2.33334 -ovc lavc -o ./vals1.avi
 
mencoder "mf://rs-*.jpg" -mf fps=2.33334 -ovc lavc -o ./vals1.avi
 
</pre>
 
</pre>
 +
 +
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.
 
The final editing was done with kdenlive, which requires no instructions.
 
{{wl-publish: 2019-06-09 15:38:05 +0000 | Laussy }}
 
{{wl-publish: 2019-06-09 15:38:05 +0000 | Laussy }}

Latest revision as of 16:11, 10 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, 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:

Mathematica-crop-vampire.png

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.

Vampiro-corrected-drift.jpg

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.

Frames-vampiro-full-cropped-processed.png

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.