Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Method/tools to create a video from images, but with control of when the images and for how long they show.



On 31/08/09 13:53, zev wrote:

> I am looking into methods to create a video from a set of images.
> The catch is that I want to show the images at specific times.
> 
> Such as show image 1 at start (0) until 2.5 seconds
> Then show image 2 at 2.5 seconds until 4 seconds.
> Next show image 3 at 4 seconds until 9 seconds.
> And so on.

As you say, ffmpeg is one tool that will do the trick.

The idea is to convert each frame into a video of a format that can be
concatenated (ie. you can simply cat multiple files into one and still have
it render). MPEG1 comes to mind.

In fact, I've just done preciesly that in order to validate the theory.

Taking your image times of 2.5, 1.5 and 5 seconds and working on a 24fps
basis, that's 60, 36 and 120 frames respectively.

Generate the "copies" of each image:

$ for i in `seq -w 1 60`; do ln image1.jpg part1_$i.jpg; done
$ for i in `seq -w 1 36`; do ln image2.jpg part2_$i.jpg; done
$ for i in `seq -w 1 120`; do ln image3.jpg part3_$i.jpg; done

Generate the individual videos using ffmpeg (that's the tool I know best) in
PAL video framesize (NTSC would be 720x480:

$ ffmpeg -r 24 -i part1_%02d.jpg -vcodec mpeg1video -s 720x576 -b 4000k \
  -aspect 4:3 -f mpeg1video part1.mp1
$ ffmpeg -r 24 -i part2_%02d.jpg -vcodec mpeg1video -s 720x576 -b 4000k \
  -aspect 4:3 -f mpeg1video part2.mp1
$ ffmpeg -r 24 -i part3_%03d.jpg -vcodec mpeg1video -s 720x576 -b 4000k \
  -aspect 4:3 -f mpeg1video part3.mp1

Join the lot together:

$ cat part[1-3].mp1 > final_video.mp1

You can then do what you want with final_video.mp1 - leave it as is or
transcode it to some other format.

-- 
G. Stewart - gstewart@example.com

Light travels faster than sound. That is why some people appear bright
until you hear them speak.

Attachment: signature.asc
Description: OpenPGP digital signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links