Lazarus

Programming => Graphics and Multimedia => Audio and Video => Topic started by: xinyiman on December 11, 2018, 12:01:17 pm

Title: jpg images to video
Post by: xinyiman on December 11, 2018, 12:01:17 pm
Hi guys, I was wondering if anyone has an example of how to make a video from a series of jpg images. For example I have 100 jpg images and I want them to become a video (assuming that those images were taken with a frequency of 100 milliseconds.
A cross platform procedure would be necessary.
Thanks for your help
Title: Re: jpg images to video
Post by: correa.elias on December 11, 2018, 12:54:15 pm
You can call ffmpeg using TProcess from your pascal program.
Title: Re: jpg images to video
Post by: metis on December 12, 2018, 05:08:25 pm
@xinyiman

Quote
You can call ffmpeg using TProcess...
If You need it a bit more detailed, see
http://forum.lazarus.freepascal.org/index.php/topic,43411.0.html (http://forum.lazarus.freepascal.org/index.php/topic,43411.0.html)
-> GoTo: "RunFFmpeg".

For how to build the FFmpeg-CommandLine, see http://ffmpeg.org/ffmpeg.html (http://ffmpeg.org/ffmpeg.html)
-> GoTo: "You can extract images from a video, or create a video from many images"
                -> "For extracting images from a video" and "For creating a video from many images".

E.g. to extract Images from a Video, and then recreate that Video from those Images,
copy the following CommandLines into the first Line of 'RunFFmpeg' and click [Grab].

Video -> Images:
-i "tmp/Video2Image.avi" -f image2 tmp/frame%03d.jpg

Images -> Video:
-f image2 -framerate 12 -i tmp/frame%03d.jpg "tmp/Image2Video.avi"

'FFmpeg' is cross platform; the SourceCode of 'RunFFmpeg' is currently Windows, but You may extend it with Linux and Mac - it's OpenSource.

:)
TinyPortal © 2005-2018