Extracting thumbnail and metaData from a video[0]/ large img
Posted: 2009-04-23T08:30:42-07:00
Hi,
I am trying to extract thumbnail and selective profile info from images using Version: ImageMagick 6.5.1-3 2009-04-13 Q8 (built from source) on windows.
Now the problem comes with the large images(100mB) or video files(3mB mpeg with 1000 frames) as even after supplying a large memory area to use so that imageMagick does not have to do any disk-swapping it takes a really long time( in minutes) to create the in-memory pixel cache.
I don't really require the cache as i simply want a thumbnail and the metadata of the image. But the moment I call readImage or blobToImage methods the pixel cache generation starts automatically.
Is there some way by which I can avoid this pixel cache and get the thumbnail and the metadata.
The only way I could find was using stream but then I was unable to extract thumbnail or metadata using that.
On the command line if I say identify -ping then that also extracts limited information pretty fast irrespective of the size of the multimedia file. I tried looking into identify code to see if I could get some lead but that also did not help.
Another thing for files like psd,gif,mpeg etc. which contain multiple layers or scenes I simply want to get thumbnail and metadata for the first scene or layer.
To achieve that I am using the following sequence so as to avoid loading all the frames or layers in the memory:
Magick::Image image;
image.subImage(3);
image.subRange(1);
image.read("file.gif");
The above code is from one of the posts I found on the forum and too be honest I don't really understand the difference between subImage and subRange. Is this really the best way to do it or is there some even more efficient method?
I did not use the STL method as there the only method which could help was readImages but then that would first read in all the images and then only i will be able to access the one required by me using the list<image>
I am trying to extract thumbnail and selective profile info from images using Version: ImageMagick 6.5.1-3 2009-04-13 Q8 (built from source) on windows.
Now the problem comes with the large images(100mB) or video files(3mB mpeg with 1000 frames) as even after supplying a large memory area to use so that imageMagick does not have to do any disk-swapping it takes a really long time( in minutes) to create the in-memory pixel cache.
I don't really require the cache as i simply want a thumbnail and the metadata of the image. But the moment I call readImage or blobToImage methods the pixel cache generation starts automatically.
Is there some way by which I can avoid this pixel cache and get the thumbnail and the metadata.
The only way I could find was using stream but then I was unable to extract thumbnail or metadata using that.
On the command line if I say identify -ping then that also extracts limited information pretty fast irrespective of the size of the multimedia file. I tried looking into identify code to see if I could get some lead but that also did not help.
Another thing for files like psd,gif,mpeg etc. which contain multiple layers or scenes I simply want to get thumbnail and metadata for the first scene or layer.
To achieve that I am using the following sequence so as to avoid loading all the frames or layers in the memory:
Magick::Image image;
image.subImage(3);
image.subRange(1);
image.read("file.gif");
The above code is from one of the posts I found on the forum and too be honest I don't really understand the difference between subImage and subRange. Is this really the best way to do it or is there some even more efficient method?
I did not use the STL method as there the only method which could help was readImages but then that would first read in all the images and then only i will be able to access the one required by me using the list<image>