converting to MPG

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

converting to MPG

Post by dognose »

I'm trying to convert an animated gif to a mpg movie

convert anim.gif movie.mpg

doing it on the command line, it works fine... however, when run from a webpage, it produces:

convert: delegate failed `"ffmpeg" -v -1 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2 -i "%M%%d.jpg" "%u.%m" 2> "%Z"' @ error/delegate.c/InvokeDelegate/1058.

So, it seems like a permissions or environment problem with the ffmpeg delegate..

Any ideas on how to trace / fix this ?

convert --version
Version: ImageMagick 6.7.0-0 2011-05-24 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: converting to MPG

Post by fmw42 »

I suspect it is an issue of your web interface/API (such as PHP) not knowing about ffmpeg.
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

Re: converting to MPG

Post by dognose »

It's not using an api, just exec call.

How would I tell IM where the ffmpeg is.... or where should I put it?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: converting to MPG

Post by fmw42 »

does ffmpeg show up in your list of delegates?

convert -list configure

and look at line starting with DELEGATES.
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

Re: converting to MPG

Post by dognose »

#convert -list configure | grep DEL
DELEGATES bzlib fontconfig freetype gs jpeg jng jp2 lcms lqr mpeg png rsvg tiff x11 xml wmf zlib

Says it supports mpeg? no ffmpeg listed.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: converting to MPG

Post by fmw42 »

the fact that it lists mpeg may be an indication you have ffmpeg installed

try

which ffmpeg

to see where it is installed.

also try

man ffmpeg

to get usage information.
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

Re: converting to MPG

Post by dognose »

Well, I know ffmpeg is installed.

/usr/bin/ffmpeg

Like I said, the convert to mpg works on the command line, but not from exec in php.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: converting to MPG

Post by fmw42 »

then I suspect php needs to be configured to know where it is. unfortunately I don't know how to do that.
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

Re: converting to MPG

Post by dognose »

Ok. I think I found out what was happening.
combination of two things.. which make it all the more difficult.

It wasn't seeing the ffmpeg in the path...

and it tries to create a log file, but didn't have permissions in the directory it's trying to do that.

The log seems sort of unnecessary, not sure if it's only in my version, but it probably could be turned off by IM.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: converting to MPG

Post by anthony »

Turning off the log is probably an extra option to ffmpeg to be added to the delegate entry.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
benleon
Posts: 1
Joined: 2011-08-20T01:00:54-07:00
Authentication code: 8675308

Re: converting to MPG

Post by benleon »

Dognose, thanks for sharing. I've got the same issue. Would be great to get some more information about your fix?
Post Reply