Page 1 of 1

New Image Magick user - Help creating mpg

Posted: 2008-02-23T15:14:34-07:00
by algarve
I woukd like to create an mpg with 5 jpeg images from one directory and tried this

#!c:\perl\bin\perl.exe -w
print "Content-type: text/html\n\n";
# generate the animation
my $mpegname = "movie.mpg";
print `convert -delay 1 *.jpg $mpegname`;
print "finished";
exit;

But i get an error message in bowser
N must be positive convert: Delegate failed `mpeg2enc.exe "%i" "%o"'. finished
Im runing windows xp with
ActivePerl-5.10.0.1002-MSWin32-x86-283697.msi
ImageMagick-6.3.8-9-Q16-windows-dll.exe
installed
All the other commands work fine, have tried most of the examples of your pages.
So i know that the code is wrong but have no idea where to start and could not find any examples with mpg only with gif animation. So if somoeone could show me an example.
Thanks in advance

Re: New Image Magick user - Help creating mpg

Posted: 2008-02-28T05:47:44-07:00
by algarve
I have solved the problem myself

With ffmpeg

ffmpeg -f image2 -vcodec mjpeg -y -i %d.jpg anim.mpg

Re: New Image Magick user - Help creating mpg

Posted: 2008-03-13T01:12:28-07:00
by laurik_vertex
It seems that Image Magick (version 6.3.9 which I tested ) has a bug.
Image Magick executes the mpeg2enc.exe with following parameters:

mpeg2enc.exe "PATH_TO_TEMP/magick-EMZiPPWd" "PATH_TO_TEMP/magick-UBa8cAXl"

where PATH_TO_TEMP is my temporary path. The file pointed by first parameter seems to have yuv-stream and the second is the parameter file for mpeg encoder.

However, regarding to the documentation of mpeg2encode, the parameters should be as:
"Usage: mpeg2encode in.par out.m2v"

I tested mpeg2encode with proper parameter-order and data generated by ImageMagick, and I was able to create a playable mpeg-animation.