subimage specification returns no images

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
Jerware
Posts: 4
Joined: 2014-08-21T23:02:26-07:00
Authentication code: 6789

subimage specification returns no images

Post by Jerware »

I'm running the following command from a Windows shell:

Code: Select all

convert "video.mpeg[2000-3999]" -coalesce -background black -alpha remove -type truecolor -resize 16x16! -quality 100 "temp\%06d.bmp"
It spits out all 2000 files perfectly, but then it reports the following error:

convert.exe: subimage specification returns no images `video.mpeg' @ error/constitute.c/ReadImage/577.

Normally I wouldn't mind because I'm getting the desired frames extracted, but I need to share this process with my users and I don't want them confused. Is something wrong with my command? Any help is appreciated. Thanks!

EDIT: I should note that frames [0-1999] do not report an error.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: subimage specification returns no images

Post by snibgo »

Looking at that source code, which is complex, IM is trying and failing to clone all the images. It only does this when you have a scene geometry, eg [2000-3999]. Perhaps it is running out of memory. (Cloning shouldn't take much memory, but may take you over a threshold. Each image has a 13,000 bytes overhead so 2000 takes 26 MB.) How large are the video frames?

This isn't a fatal error. Does "-quiet" suppress the message?

You can redirect messages with "2> file.txt", then check the file for fatal error messages.
snibgo's IM pages: im.snibgo.com
Jerware
Posts: 4
Joined: 2014-08-21T23:02:26-07:00
Authentication code: 6789

Re: subimage specification returns no images

Post by Jerware »

Thanks for investigating. Using -quiet does not hide the error. I don't think it's a memory issue though. I've simplified the problem, and you can see for yourself.

Download this 48k video file, which is 640x480 and 20 frames long:
http://ledseq.com/downloads/20frames.mp4

Run the following and it works fine:

Code: Select all

convert 20frames.mp4[0-9] -type truecolor -resize 16x16! -quality 100 %06d.bmp
Run the following and you get the error:

Code: Select all

convert 20frames.mp4[10-19] -type truecolor -resize 16x16! -quality 100 %06d.bmp
Thoughts?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: subimage specification returns no images

Post by snibgo »

The bug seems to be complex. It seems to happen when last < 2 * first. Eg [3-4] and [3-5] creates the error; [3-6] is okay.

This occurs with the mp4 file, but not if I first convert it to a multi-page tiff and extract images from that tiff.

Hence the problem may be an interaction with ffmpeg. I don't have a suitable environment for testing further.

Please report this on the bugs forum viewforum.php?f=3, with a link to this thread.
snibgo's IM pages: im.snibgo.com
Jerware
Posts: 4
Joined: 2014-08-21T23:02:26-07:00
Authentication code: 6789

Re: subimage specification returns no images

Post by Jerware »

Done. Thanks!
Post Reply