Using Delphi or FFMpeg to Create a Movie from an Image Sequence

My Delphi created a scratch called frame_001.png for frame_100.png.

I need it to be compiled into a movie clip. I think that perhaps the easiest way is to call ffmpeg from the command line according to their documentation:

To create video from many images:

ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi

The syntax foo-% 03d.jpeg indicates the use of a decimal number of three digits filled with zeros to express the sequence number. This is the same syntax supported by the printf C function, but only formats that accept a normal integer are suitable.

From: http://ffmpeg.org/ffmpeg-doc.html#SEC5

However, my files (lossless) are in png format, so I need to convert using imagemagick first.

Now my command line is:

ffmpeg.exe -f image2 -i c:\temp\wentelreader\frame_%05d.jpg -r 12 foo.avi

But then I get the error:

[image2 @ 0x133a7d0]Could not find codec parameters (Video: mjpeg) c:\temp\wentelreader\Frame_C:\VID2EVA\Tools\Mencoder\wentel.bat5d.jpg: could not find codec parameters

What am I doing wrong?

Can this be alternatively done with Delphi?

+3
source share
4 answers

Look at the file name in the error message. This may not be right. The percent sign should fully correspond to the program that you are using, but instead it will expand with a batch file, where it will %0expand to the full name and path of the file. Double percent sign in batch file:

ffmpeg.exe -f image2 -i c:\temp\wentelreader\frame_ %% 05d.jpg -r 12 foo.avi

Also, why do you want five digits when you already said that your files are called frame_001.png , which has only three digits?

+2
source

ffmpeg can create a movie from png images, why do you think you need to convert them to jpeg?

+2
source

The guys at DelphiFFMpeg created component shells for FFMpeg. It is very expensive, but worth checking it out. However, what you want to do is very simple and the command line is more than enough for you.

+2
source

Source: https://habr.com/ru/post/1718800/


All Articles