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?".
I have an IP camera, where a snapshot image is available from the URL [url]http://userid:@ip-number:port/snapshot.cgi[/url] (I have a real ip and port number of course). This works fine from a browser. I'd like to grab that image and add a timestamp to it using IM. The command line (or script) I've been tying is
sh: 1: html2ps: not found
convert: delegate failed `"html2ps" -U -o "%o" "%i"' @ error/delegate.c/InvokeDelegate/1058.
convert: unable to open image `/tmp/magick-TJIy7e2T': @ error/blob.c/OpenBlob/2587.
convert: unable to open file `/tmp/magick-TJIy7e2T': @ error/constitute.c/ReadImage/571.
convert: no data returned `http://guest:@ip-number:port/snapshot.cgi' @ error/url.c/ReadURLImage/231.
convert: missing an image filename `CamPic.jpg' @ error/convert.c/ConvertImageCommand/3011.
I have another ip camera, where the snapshot url is similar, but doesn't have authentication (the "guest:" part) and ends "snapshot.jpg" instead of a cgi extension, and that works fine with convert.
sh: 1: html2ps: not found
convert: delegate failed `"html2ps"
It looks to me that the file seen by IM is HTML, not JPEG or other image. In the past, IM has had problems with colons. Can you (temporarily) change the server so "guest:" isn't required?
snibgo wrote:Can you (temporarily) change the server so "guest:" isn't required?
Unfortunately, that camera won't allow for access without authentication. The guest account was the closest I could get to no authentication. There's also the colon with the port numbers. So if IM doesn't like colon's I suppose it wouldn't like it there either.
One option I thought is that I could use wget to download and save the image first, then run convert on the downloaded image. I tried that and it worked (though seems rather inefficient). However since I would be converting the first downloaded jpeg into another jpeg, I was a bit concerned about loss of quality. Any thoughts on that??
On some versions of wget, you can "-O-" to download to standard output, then pipe it into convert. (On Windows, wget stupidly creates a file named "-".) This just makes it slightly faster.
wget won't change the file contents; it simply copies the file.
You are using convert to annotate an image. Saving as a jpeg is lossy. If you can save as something else, that would be better. If you need jpeg as the final output but will be doing some further processing before that, use another format for the intermediate files.