stop-motioner

Hi, my 7-year-old daughter got interested in creating stop-motion animations and she has shot various series of images, usually 50-200 per sequence. I used mogrify to chunk the images down to 600x400 at moderate resolution, then found Synfig among the animation packages available in Ubuntu. Encountered problems; figured out how to update to 0.61.09; running well now.
But I cannot figure out how to use Synfig to create stop-motion animations–it is as if such a procedure is so simple that no-one has written a HowTo for it. Via 179 right-clickings, I invoked File -> Import and brought in each image as a layer;
set the file properties to 6 fps for 30 seconds;
turned off all layers except the first one;
unlocked keyframes;
and created a new keyframe at each time interval after turning on each layer in sequence.
This did nothing. But then again, I have no idea from the tutorials whether any of these are correct steps. Maybe I don’t need to use keyframes at all? Or maybe each image should be imported as a keyframe through some totally different method?

I would love it if a tutorial could be created called “How to create stop-motion with Synfig”, for those of use who only want to begin with this rudimentary usage of Synfig. Also, perhaps some command-line suggestions so that we can batch-import and batch-create animation frames.

For now, I don’t want to fine-tune these animations in Synfig; let my daughter deal with controlling variables as she is generating the initial images. Later, if we can create some initial animations and she gets excited about it, I would be willing to put in the time to add sound files, correct wonky frames, etc.

I was going to create this post as a New Topic under Animation. List moderator, feel free to put it wherever it should go. But I would greatly appreciate help on this.

Hello.

An easy way of generating stop-motion, slideshows, etc is the List Importer. The wiki page is probably the best source on it.

There is also a slideshow tutorial; a link at the bottom points to an importer shell script (unlike list importer, this one creates multiple layers). However, I think using lists would be the easiest method in this case - and by far the fastest.

The reason that unchecking the layers doesn’t work is because the checkboxes enable/disable the layers globally – to my knowledge, they are not animatable. However, the “amount” parameters are (the slideshow tutorial explains that somewhat).

Good luck using Synfig!

Hi MetroPietro,
as nikitakit mentioned, ListImporter is the easiest way to create a frame by frame animation using Synfig. It has a problem beacause each frame stills exactly 1/FPS seconds and all the frames stills the same. That’s because List Importer render each frame the same amount of time. You can make some tricks to make a frame still longer using the TimeOffset parameter but it seems to be difficult for a newbie, specially if she’s young.
A workaroung to make the images still longer is to introduce the same image more times in the imported list.

For example, let’s say you have 5 images (A, B, C, D, E) and they play under 3 seconds in a 5fps stop motion animation. Inserting those images in the ‘lst’ file like this:

A
A
A
B
B
B
C
C
C
D
D
D
E
E
E

would produce an averaged stop motion animation.
If you need that some frames are quicker than other just insert less frames for the quicker and more for the slower keeping the rest of the timing

A
A
A
A
A
B
C
C
C
D
D
D
E
E
E

I’ll try to make a better stop motion tutorial but I need to think what’s the best way, though.

Please check out the sticky post on “Building Synfig” forum relative to Ubuntu 8.10. Packages binaries links at the top of the first post are the easier way to install synfig in ubuntu . If you’re using 9.04 you’ll find that the one form the repositories is badly created. Remove it and try to install the same packages I recommend for 8.10. I’m working on a how to install synfig on 9.04 post, because some of the targets (magick++ and libav) doesn’t seem to work.

-G

Hi all, sorry I dropped off radar for a month; writing a dissertation. I followed the advice you gave, as well as a bit of Googling to fill in some gaps. I came up with this draft tutorial. Please let me know what you think.

Stop-Motion Animation Tutorial
Synfig is a very sophisticated animation program which can incorporate raster and vector graphic data in multiple layers with fine control of both time and crossfade. However a basic stop-motion animation is much simpler, using only a few of the functions in Synfig. This tutorial focuses on creating a stop-motion animation from still frames with no crossfade transition. It may therefore be useful as an introductory tutorial to provide a quick introduction to a few controls, before you use Synfig for more elaborate editing.

Preparing the images
Images can be captured or generated in a variety of ways. One example would be a sequence of scanned hand-drawings; another would be screen-captures of a drawing created in a computer program, from GIMP, Photoshop, Inkscape, Illustrator, or a CAD program. A third source would be a series of digital camera photographs of a set in which figures are moved incrementally between photographs.
In all cases, the sequence of images may need to be reduced in size and color depth to reduce file-size. Whereas a scanner or camera may capture images at 2000x3000 pixels, a typical YouTube animation is perhaps 640x360 pixels (in my case, 533x400 pixels). Consider your final output size, requisite image quality, and the processing power of your computer. Working with smaller file may save you a lot of working time.

I am on Linux (Ubuntu), and I use shell commands to batch process the images. The commands some from the suite “imagemagick”. To install these shell utilities on an Ubuntu system, enter:

sudo apt-get install imagemagick

Then you can use batch processing commands such as:

mogrify -verbose -resize 533x400 -quality 60% *.jpg

(You can also use mogrify to batch-convert file formats, but that is not necessary here.)

However you obtain, process, and crop images, the end result should be a directory with a sequence of images in it. This directory will be used in the next step.

Create a frame-list file
Once you have your sequence of images processed and edited to taste, make a list of the images and save it in a text file with the suffix .lst (the first character is an “el”; the suffix stands for “list”). You can do this from the command line in a *nix system by navigating to the directory with the images in it, listing the images (ls *.jpg) and outputting the result (>) to a named file (such as “frame.lst”). The whole shell command is:

ls *.jpg > frame.lst

You may want to add a line at the beginning of the list file to specify the frame-rate of the animation. By default it is 24 FPS, but you may want faster or slower. In my case I want slower, so I added the line:
FPS 4
to the top of the file. This will set the frame rate at ten per second. A list file should look like this:
FPS 10
DSC07648.jpg
DSC07651.jpg
DSC07652.jpg
DSC07653.jpg
DSC07654.jpg
DSC07655.jpg
DSC07656.jpg
DSC07657.jpg
DSC07659.jpg
…etc

Import frame-list into Synfig
You will import the frame-list text file into Synfig the same way you would import any other image.
Start Synfig. To access the full menu controls, you need to left-click the square at the top left corner on the Canvas Window where the margin-rulers meet. Under Edit -> Properties… Set the canvas size to the same size as your images.

Next, set the duration to at least as long as your sequence. In my case, 158 frames / 4 FPS = 39.5s.

Then choose File -> Import… and the Import Dialog comes up. Navigate to the directory that has both the frame-list file and the images in it. Import the frame-list file.

Test the animation with View -> Play.

Rendering
Choose File -> Render… and output to a .dv (digital video) file.
Unfortunately the current version of Synfig on the current version of Ubuntu (9.04) does not output small video files, such as the MPEG format. It claims it does, but no file is produced. In any case, the most universal compact video format is Flash video. To convert from .dv to .flv, use the shell command ffmpeg.

Convert bulky output using ffmpeg
Or, since I have already output a high-resolution (but very large) .dv file, I can convert it to .flv format using the shell command ffmpeg. Its syntax is:

ffmpeg -i [infile] -f [outfile format] -r [FPS] -s [(width)x(height)] [outfile].[filetype]

In this case,

ffmpeg -r 4 -i Dino-stopmotion4FPS.dv -f flv -r 4 -s 534x400 dino_stopmotion2.flv

This produces an .flv file which is 1.1 MB, compared to the original .dv file which is 138 MB!

NOTE 1: if I do not specify the size, the output is the same size as the .dv file output, but pixelization is a little more noticeable. I think I could tweak some options or parameters to increase visual smoothness, though that would increase file size.

NOTE 2: the option -r 4 may be unnecessary, because the FPS was already specified in the .dv file.

NOTE 3: the original file was 533x400, but ffmpeg requires a even-numeral pixel size. So I changed to 534x400; this worked, but it would be better to start with even-numbered pixels at the beginning.

Nice tutorial MetroPietro,
but I think that if you simply want to make a movie with a sequence of images with the same duration all them you can do it directly using ffmpeg command line, stitching all the images together with the proper frame rate value.

synfig.org/How_do_I#Renderin … g_sequence.
-G

I looked at ffmpeg in some detail and I could not find any person who had described successfully stitching together a sequence of discrete still-frame files. The “Rendering through a .png sequence” does not fully explain this process; it explains how to generate .png output from a .sifz file using ffmpeg, but it is not clear whether such an output of .png files is the same as a series of freestanding digitial camera images. To clarify, let me ask by example: let us assume we have a directory of JPEG images with names like:
DSC07648.jpg
DSC07651.jpg
DSC07652.jpg
DSC07653.jpg
DSC07654.jpg
DSC07655.jpg
DSC07656.jpg
DSC07657.jpg
DSC07659.jpg
…etc
They are in order, but not continuous, because some bad photos have been removed from the sequence. To stitch them together using ffmpeg, I assume the command would be something like:

ffmpeg -i [wildcard_that_denotes_all_JPEG_images_in_the_directory] -f flv -r 4 -s 600x400 outfile_animation.flv

…but other than some speculation about how one might do this with a PERL script back in 2006, Googling revealed no indication that it could be done, let alone an explanation of how it could be done. The instructions on http://www.synfig.org/Tips#Rendering_through_a_.png_sequence suggest that wild-carding is possible, with %04d somehow acting as a wildcard. If this expression is acting as a wildcard, where do I learn this syntax? Will I have to rename all the JPEGs in the directory to a nomenclature which can fit this wildcard syntax? So far as I could find, the ffmpeg manpage does not explain this.
Sorry this discussion has drifted towards ffmpeg for the moment, because I really like Synfig! This particular stop-motion problem may be too simple to justify using Synfig, but I can imagine other issues where Synfig will be very useful.

No problem on discuss here ffmpeg issues. We support any kind of opensource.
The usage of wilcards is explained in the shell manual that you’re using that I assume that it is bash. See gnu.org/software/bash/manual/ for further references. I admit that I don’t have long experience on using bash but it can do very powerful things.

Anyway use dv format when use synfig is not the best practice because it will change the aspect ratio and the frame rate. It is better to export again the image sequence and then stitch them using ffmpeg or even avidemux.
-G

Firstly to stitch a png-sequence together using ffmpeg the images needs to be a continuos range starting from frame 1.

The following piece of code I use in bash-scripts to re-number images to working, continuos sequences.

##### Renumber image sequence to start with #0001 ##### for f in * do currprefix=${f%[0-9][0-9][0-9][0-9]*} test "x$prevprefix" = "x$currprefix" && ((i++)) || i=1 mv -i "$f" "${f/[0-9][0-9][0-9][0-9]/$(printf %04d $i)}" prevprefix=$currprefix done ) fi
(The code is for 4 digit numberings, for 5 add an extra [0-9] in two places and change %04d to %05d)

Now when you got a correctly numbered sequence you can stitch it together with FFMPEG.

ffmpeg -i DSC%05d.jpg -vcodec libx264 -r 25 output-file.mov
This piece of code takes your image sequence, now renamed to DSC00001, DSC00002 etc., and creates a h264 coded mov.
-i is input file and here we put your sequence, all images starts with DSC and is followed with a 5 digit numbering for which we use %05d.
-vcodec is the codec you want to use and then we set the framerate to 25fps.
lastly we set the output filename.

The easiest way would be to create a bash script to handle all this.

Thank you! This explains several things that even the ffmpeg FAQ does not explain. (see:
http://www.ffmpeg.org/faq.html#SEC14 and note what is not explained there)
First, the wildcard syntax:
%[number_of_digits]d
In my particular case, with 158 frames, that would need to be at least %03d.
Second, the need for sequencing from 1 (or 01, or 001 in my case). Thus, automated PNG output from a .sifz file would work, because the output-process would number the frames from one, in a continuous sequence. Without your explanation, I would not be able to decipher why a Synfig output sequence works and a sequence of digital still camera files does not.
As for the BASH commands you use to renumber the images in a directory from 0001, I can only parse a little bit of the logic. I will try making this into a shell script to see how it works.

That’s the power of bash! \o/

Thanks rylleman. That’s a very useful script. I’ll use it too! Maybe it is worth to insert it at the wiki in the section of create a movie from image sequence?
-G

I’ve got a few different bash-scripts I’ve put together to do different conversions and renders. Keeping code in different blocks like the one for renaming makes it very easy to create new ones, just find the proper block and copy it.

I’ll share some of the more widely useful scripts.

Metro. Yes, FFMpeg can take some time to figure out. I’ve done quite a lot of trial and error to find out what’s working and what’s not.
And for the logic in the rename code, I can only figure it out if I squint really hard and scratch my head. I got some help putting that piece together…

Just thought I’d mention that for those on Ubuntu (and perhaps other Linux flavors) there’s a great little utility in the repositories for renaming batches of files. It’s called pyRenamer and it has an easy-to-use GUI.

Matt