====== How to make a good animation ====== A small guide on how to realise good animations starting from figures and using [[http://www.virtualdub.org/|VirtualDub]] and the [[https://www.xvid.com/|Xvid]] codec. VirtualDub can be downloaded through [[http://www.liberkey.com/|LiberKey]]. ===== Before getting started ===== * Remember to make big figures and in high resolution (the extension is arbitrary but too compressed formats, like JPEG, should be avoided). * Figures have to be numbered in increasing order. ===== How to make an animation using VirtualDub ===== ==== Quick step-by-step tutorial ==== * Open VirtualDub. * Drag the first figure, "Figure 0", into VirtualDub (all the subsequent figures will be automatically imported) or select the figure with ''File''->''Open video file''. On the left pane, you see the original image and on the right pane, the image as it will appear in the video. Right-click the images to zoom/unzoom. {{ :devel:virtualdub:virtualdub01.png?direct&600 |}} * A lot of tools are available to adjust the video. You should at least define the size, framerate and compression properties with the ''Video''-menu. {{ :devel:virtualdub:virtualdub02b.png?direct&400 |}} - Add a ''Resize''-filter to define the output size. If the video is to be displayed with a video projector, it is advised to adjust the size according to the projector resolution (typically no more than 1280*1024). Some codecs (xvid) require picture size multiple of 4 or 16, for example; this can be done automatically with the ''Codec-friendly sizing'' option. {{ :devel:virtualdub:virtualdub03b.png |}} - Click on ''Frame Rate'' to choose the number of frames per second. {{ :devel:virtualdub:virtualdub04.png |}} - Click on ''Compression'' to choose the compression format. Xvid is a sensible choice but the Xvid-codec must be installed separately before you can use it in Virtual Dub. __NB__: in ''Configure'', set the ''Target quantizer'' to 2.0 for a better quality on mesh drawing (or keep 4.0 for a better compression keeping a good quality). {{ :devel:virtualdub:virtualdub05.png |}} * Select ''File -> Save as AVI'' to create the animation. ==== Modify the animation parameters: filters ==== Usually, before creating the animation, you want to make some modifications, for example setting the dimensions of the animation in order to have the right output size (resizing an animation, in PowerPoint for instance, should be avoided). To modify the animation you can use the different __filters__ provided by VirtualDub. Those needed in this context are: * **Resize**: to change the dimensions of the animation, by predefined patterns or in a customized fashion (see above). __NB__: some codecs require dimensions that are multiple of some quantity (2, 4, 16, etc...). To take this into account you can either select one of the "Codec-friendly" options in the filter manager or do it by hand using the Crop filter (see next point). * **Crop**: to crop figures (to get rid of undesired edges for instance, or to adjust the dimensions to match particular codec requirements). * **Logo**: to insert a logo in the animation. __Remark 1__: if the codec constraints on the dimensions are not respected, VirtualDub will refuse to proceed when clicking on Save as AVI. __Remark 2__: VirtualDub is also capable to re-read an AVI file: an animation can be therefore modified even once created. __NB__: in this case the resolution will not be the same of the original figures but the one chosen when the animation was created! __Remark 3__: The Resize filter can also be used to obtain animations of the right size to be uploaded on [[https://www.youtube.com/channel/UC4G1VzsYVgcOGWiUVIEnmJg|YouTube]] (avoiding in this way the automatic addition of black edges in order to compensate the difference between the dimensions of the uploaded video and those imposed by YouTube). __Remark 4__: If you need to convert the AVI file into another format, this can be easily done using Format Factory (available through LiberKey).