Page 1 of 1

identify video delegate ffmpeg parameter correction

Posted: 2012-04-26T02:55:25-07:00
by fgro
Hi folks,

when you identify a video file imagmagick delegates to ffmpeg.

The current delegates.xml entry reads:

Code: Select all

<delegate decode="mpeg:decode" command=""ffmpeg" -v -1 -vframes %S -i "%i" -vcodec pam -an -f rawvideo -y "%u.pam" 2> "%Z""/>
However, the -vframes parameter must come after the input file parameter, otherwise it will be ignored and every frame will be processed when calling identify on a specific frame such as

Code: Select all

identify video.mp4[0]
This may lead to heavy cpu load as well as tmp folders quickly filling up with data.

Hence, the correct delegates.xml entry should read something like this:

Code: Select all

<delegate decode="mpeg:decode" command=""ffmpeg" -v -1 -i "%i" -vframes %S -vcodec pam -an -f rawvideo -y "%u.pam" 2> "%Z""/>
Please note this fix is for the latest version of ffmpeg. On older ffmpeg versions (i.e. 0.7.8 ) the misbehaviour does not seem to occour.

For reference, here the according ffmpeg bug:
https://ffmpeg.org/trac/ffmpeg/ticket/898


Happy video identifying ;-)

Re: identify video delegate ffmpeg parameter correction

Posted: 2012-04-26T04:06:22-07:00
by magick
Thanks, we'll get the patch into the next point release of ImageMagick.