External access to snapshots of cameras
External access to snapshots of cameras
I'm wondering if there's a way to get snapshot of a particular camera (read "Zoneminder" monitor) in form of URL to JPEG?
This is my use-case:
I have N FullHD IP-cameras (1920x1080, h264 in RTSP) configured in Zoneminder.
I have another hand-made application that displays snapshots from all those cameras on one screen so I can see what's happening around now. In that my application now I'm retrieving snapshots directly from each camera via specific URL.
And with that approach of getting snapshots directly from cameras I have at least 2 issues:
[1] I want to separate [physically] network with cameras from [let's call it] generic "home network" and connect cameras to a dedicated network adapter of server that runs Zoneminder. But if I do so I won't be able to access cameras directly from devices that work in another network (in which Zoneminder web-interface is visible). So if I may get the same snapshots from Zoneminder server I won't need direct access to cameras.
[2] Even though I now may get snapshots from cameras directly I see almost every snapshot has corrupted areas/segments while h264 stream is perfectly correct at all times. I hope that with offloading JPEG creation from cameras to powerful Zoneminder machine and with move of many h264 streams to a separate network will help to resolve problem with corrupted JPEGs/snapshots as well.
I tried to use URLs of images I saw in Zoneminder window like "192.168.0.128/cgi-bin/zm/nph-zms?mode=jpeg&monitor=8" but outside of Zoneminder window by that URL I saw nothing. Probably I'm doing something stupidly wrong but looks like I'm out of ides.
Thanks a lot for any help or suggestions.
This is my use-case:
I have N FullHD IP-cameras (1920x1080, h264 in RTSP) configured in Zoneminder.
I have another hand-made application that displays snapshots from all those cameras on one screen so I can see what's happening around now. In that my application now I'm retrieving snapshots directly from each camera via specific URL.
And with that approach of getting snapshots directly from cameras I have at least 2 issues:
[1] I want to separate [physically] network with cameras from [let's call it] generic "home network" and connect cameras to a dedicated network adapter of server that runs Zoneminder. But if I do so I won't be able to access cameras directly from devices that work in another network (in which Zoneminder web-interface is visible). So if I may get the same snapshots from Zoneminder server I won't need direct access to cameras.
[2] Even though I now may get snapshots from cameras directly I see almost every snapshot has corrupted areas/segments while h264 stream is perfectly correct at all times. I hope that with offloading JPEG creation from cameras to powerful Zoneminder machine and with move of many h264 streams to a separate network will help to resolve problem with corrupted JPEGs/snapshots as well.
I tried to use URLs of images I saw in Zoneminder window like "192.168.0.128/cgi-bin/zm/nph-zms?mode=jpeg&monitor=8" but outside of Zoneminder window by that URL I saw nothing. Probably I'm doing something stupidly wrong but looks like I'm out of ides.
Thanks a lot for any help or suggestions.
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: External access to snapshots of cameras
The way to solve item #1 is to get yourself a managed switch that supports vlan tagging.
Configure your camera and data networks for different vlans.
You then need a layer 3 routing device. You can pay more for a network switch that supports static routing. Another approach would be to use something like pfSense. It is a free software based firewall, which has a ton of functionality, including vlan support and routing between vlans.
This gets you want you want. You end up with two separate networks and the ability to directly communicate with your cameras from your data network.
I am hopeful that someone else who has actually done item #2 will reply. There are likely multiple ways to do this depending on what you want.
Zoneminder stores all events as jpeg's on your filesystem, so if you just want a jpeg from the most recent event then that is just an issue of searching for the most recent jpeg under your events folder.
If you want a jpeg that represents "now", then you may need to look into using zmtrigger to trigger an event at that point in time.
Here is an example of triggering an event via external means:
http://www.sparxeng.com/blog/software/z ... triggering
Configure your camera and data networks for different vlans.
You then need a layer 3 routing device. You can pay more for a network switch that supports static routing. Another approach would be to use something like pfSense. It is a free software based firewall, which has a ton of functionality, including vlan support and routing between vlans.
This gets you want you want. You end up with two separate networks and the ability to directly communicate with your cameras from your data network.
I am hopeful that someone else who has actually done item #2 will reply. There are likely multiple ways to do this depending on what you want.
Zoneminder stores all events as jpeg's on your filesystem, so if you just want a jpeg from the most recent event then that is just an issue of searching for the most recent jpeg under your events folder.
If you want a jpeg that represents "now", then you may need to look into using zmtrigger to trigger an event at that point in time.
Here is an example of triggering an event via external means:
http://www.sparxeng.com/blog/software/z ... triggering
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: External access to snapshots of cameras
Thanks a lot for your reply.
But my question was not really on how to implement [1] or [2] but how to use ZoneMinder server as a source of "real-time" images from all its "monitors". Think about that as a possibility to display ZoneMinder's monitor on remote (still located in the same network) device.
But my question was not really on how to implement [1] or [2] but how to use ZoneMinder server as a source of "real-time" images from all its "monitors". Think about that as a possibility to display ZoneMinder's monitor on remote (still located in the same network) device.
Re: External access to snapshots of cameras
You mean use ZM to grab a monitor feed and save it as an image?bolick wrote:I'm wondering if there's a way to get snapshot of a particular camera (read "Zoneminder" monitor) in form of URL to JPEG?
.
Code: Select all
wget "http://yourserver/cgi-bin/zms?mode=single&monitor=1&user=xxx&pass=yyy" -O foo.jpg
Last edited by asker on Wed Jul 15, 2015 7:08 pm, edited 1 time in total.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: External access to snapshots of cameras
And that is why I mentioned using zmtrigger. If you want a jpeg that is recent, then you need to tell zoneminder to create an event first. You use zmtrigger to do that.bolick wrote:Thanks a lot for your reply.
But my question was not really on how to implement [1] or [2] but how to use ZoneMinder server as a source of "real-time" images from all its "monitors". Think about that as a possibility to display ZoneMinder's monitor on remote (still located in the same network) device.
BTW, You can use the same url's that zoneminder uses, but that will generate a stream, rather than a static jpeg.
To figure out what the url should be, open a live view, right click the image itself and copy the image location to the clipboard. That is all you need if zoneminder authentication is set to off or plain.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: External access to snapshots of cameras
I'll be damned. That works? It gives you just one jpeg and not a mjpeg stream?asker wrote:You mean use ZM to grab a monitor feed and save it as an image?bolick wrote:I'm wondering if there's a way to get snapshot of a particular camera (read "Zoneminder" monitor) in form of URL to JPEG?
.
wget "http://yourserver/cgi-bin/zms?mode=sing ... x&pass=yyy" -O foo.jpg
replace '1' with the correct monitorId and xxx and yyy with your login/passwords
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: External access to snapshots of cameras
Yup it works. That's what I am doing in zmNinja to work around the max 10 (or 6) connections open problem of Chrome
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Re: External access to snapshots of cameras
You can also set up a web page to access the camera streams. This will expose your user and password but if you create an unprivileged user in ZM it should not hurt security. If your ZM system is on an isolated LAN throw another LAN card in to access your server from another subnet/internet.
My code:
<html>
<meta http-equiv="refresh" content="300">
<body>
<p>Reception Camera Group</p>
<img src="http://server-url-or-ip/cgi-bin/nph-zms ... &pass=user">
<img src="http://server-url-or-ip/cgi-bin/nph-zms ... &pass=user">
<img src="http://server-url-or-ip/cgi-bin/nph-zms ... &pass=user">
<img src="http://server-url-or-ip/cgi-bin/nph-zms ... &pass=user">
</body></html>
My code:
<html>
<meta http-equiv="refresh" content="300">
<body>
<p>Reception Camera Group</p>
<img src="http://server-url-or-ip/cgi-bin/nph-zms ... &pass=user">
<img src="http://server-url-or-ip/cgi-bin/nph-zms ... &pass=user">
<img src="http://server-url-or-ip/cgi-bin/nph-zms ... &pass=user">
<img src="http://server-url-or-ip/cgi-bin/nph-zms ... &pass=user">
</body></html>
Re: External access to snapshots of cameras
>> wget "http://yourserver/cgi-bin/zms?mode=sing ... x&pass=yyy" -O foo.jpg
>>
>> replace '1' with the correct monitorId and xxx and yyy with your login/passwords
That URL made a trick.. well with only 1 exception that I had to add "zm" betweeen "cgi-bin" and "zms".
And to be honest I'm very happy now because:
[1] I'm seeing perfectly correct snapshots instead of corrupted JPEG's I got directly from cameras.
[2] Moreover IP cameras that used to reset itself to some factory defaults (which among other things switched capture format from 1080p to 720p and what's even more disturbing picture was rotated on 180 degrees effectively giving upside down footage) now work stable - no issues so far since I switched to snapshots from ZoneMinder.
Thanks a lot!
>>
>> replace '1' with the correct monitorId and xxx and yyy with your login/passwords
That URL made a trick.. well with only 1 exception that I had to add "zm" betweeen "cgi-bin" and "zms".
And to be honest I'm very happy now because:
[1] I'm seeing perfectly correct snapshots instead of corrupted JPEG's I got directly from cameras.
[2] Moreover IP cameras that used to reset itself to some factory defaults (which among other things switched capture format from 1080p to 720p and what's even more disturbing picture was rotated on 180 degrees effectively giving upside down footage) now work stable - no issues so far since I switched to snapshots from ZoneMinder.
Thanks a lot!
Re: External access to snapshots of cameras
Well that was the first thing I tried but with no luck. Even though I don't have any users set at all so I assume it should not be a matter of authentication.knnniggett wrote: BTW, You can use the same url's that zoneminder uses, but that will generate a stream, rather than a static jpeg.
To figure out what the url should be, open a live view, right click the image itself and copy the image location to the clipboard. That is all you need if zoneminder authentication is set to off or plain.
BTW that's a URL I'm getting by rigth-clicking on ZM monitor's image:
Code: Select all
http://192.168.0.128/cgi-bin/zm/nph-zms?mode=jpeg&monitor=1&scale=50&maxfps=30&buffer=1000&connkey=543576&rand=1437118775
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: External access to snapshots of cameras
Yes, you did, but the example you gave in your first post was missing a few parameters in the url, which is why it didn't work.bolick wrote: Well that was the first thing I tried but with no luck. Even though I don't have any users set at all so I assume it should not be a matter of authentication.
Not an issue now that Asker enlightened us that "mode=single" was the magic to get zonemidner to return a jpeg rather than a stream.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
-
- Posts: 8
- Joined: Fri May 11, 2018 9:33 pm
Re: External access to snapshots of cameras
Hey I just registered for this board to thank you for this post. It works perfectly for me too!bolick wrote: ↑Fri Jul 17, 2015 7:34 am >> wget "http://yourserver/cgi-bin/zms?mode=sing ... x&pass=yyy" -O foo.jpg
>>
>> replace '1' with the correct monitorId and xxx and yyy with your login/passwords
That URL made a trick.. well with only 1 exception that I had to add "zm" betweeen "cgi-bin" and "zms".
And to be honest I'm very happy now because:
[1] I'm seeing perfectly correct snapshots instead of corrupted JPEG's I got directly from cameras.
[2] Moreover IP cameras that used to reset itself to some factory defaults (which among other things switched capture format from 1080p to 720p and what's even more disturbing picture was rotated on 180 degrees effectively giving upside down footage) now work stable - no issues so far since I switched to snapshots from ZoneMinder.
Thanks a lot!