Creating a timelapse clip with avconv

avconv must be installed

Make sure you have a list of JPEG files in one directory and that they are named sequentially i.e.


Some versions of avconv will insist on the files starting with ‘0000’ somewhere in the first file. To rename the files, use the following command:-

ls *.JPG| awk 'BEGIN{ a=0 }{ printf "mv %s myfile%04d.JPG\n", $0, a++ }' | bash

This will rename all your files to:-


If you wan to create a clip with the original resolution (4256 x 2832 in this case) with high quality, use the following command:-

avconv -y -r 10 -i myfile%4d.JPG -r 10 -vcodec libx264 -q:v 3  -vf crop=4256:2832,scale=iw:ih tlfullhiqual.mp4;

-y forces avconv to overwrite any file
-r 10 creates a clip with 10 frames per seconds (for some versions of avconv you have to specify it twice)
-i specifies the input file(s). %4d means any 4 decimal numbers
-vcodec specifies the video codec to be used (H.264 in this case)
-q:v specifies the quality, value ranges from 1 (best) to 31 (worse)
crop= specifies which area of the images will be cropped
scale= indicates how much scaling must take place (in the above example iw:ih indicates that the output width and height will be that of the in width and in height)
the last parameter is the output file

To create a clip that is a quater of the height and width as the original with less image quality, use the following command:-

avconv -y -r 10 -i myfile%4d.JPG -r 10 -vcodec libx264 -q:v 20 -vf crop=4256:2832,scale=iw/4:ih/4 tlsmallowqual.mp4;

To create a .flv file

avconv -y -r 10 -i myfile%4d.JPG -r 10 -vcodec libx264 -q:v 3 -vf crop=4256:2832,scale=320:-1 -c:v flv tlsmallest.flv;

Here I moved the quality up, because the resolution is low

Add a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.


  1. ssshake

    I’m trying this, I end up with a 10 second clip but each frame is the same image

  2. ssshake

    nevermind im just stupid