I am trying to make a bunch of png\'s into a video using avconv, the png\'s are numbered like filename_
so I usually just use the command:
Check this out; according to ffmpeg this is how they doing it and it works
img1.jpg, img2.jpg, img3.jpg, ...
Then you may run:
ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
Notice that %d
is replaced by the image number.
img%03d.jpg
means the sequence img001.jpg
,
img002.jpg
, etc.
Use the ‘-start_number’ option to declare a starting number for the
sequence. This is useful if your sequence does not start with
img001.jpg
but is still in a numerical order. The following
example will start with img100.jpg
:
ffmpeg -f image2 -start_number 100 -i img%d.jpg /tmp/a.mpg
If you have large number of pictures to rename, you can use the
following command to ease the burden. The command, using the bourne
shell syntax, symbolically links all files in the current directory
that match *jpg to the /tmp
directory in the sequence of
img001.jpg
, img002.jpg
and so on.
x=1;
for i in *jpg;
do counter=$(printf %03d $x);
ln -s "$i" /tmp/img"$counter".jpg;
x=$(($x+1));