identify video delegate ffmpeg parameter correction

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
fgro
Posts: 1
Joined: 2012-04-26T02:35:35-07:00
Authentication code: 13

identify video delegate ffmpeg parameter correction

Post 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 ;-)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: identify video delegate ffmpeg parameter correction

Post by magick »

Thanks, we'll get the patch into the next point release of ImageMagick.
Post Reply