Get video streaming through API

Forum for questions and support relating to the 1.30.x releases only.
Locked
thiagom10
Posts: 1
Joined: Fri May 18, 2018 2:45 am

Get video streaming through API

Post by thiagom10 »

Hi guys

I'm trying to building a specific front-end using ZoneMinder's API.
I am able to connect using the API and retrive all informations about the monitores and other stuffs, but I couldnt find how to get the
video streaming from a specific monitor to embembed it in my code... I know i can do this using something like that <img src="https://example.com/zm/cgi-bin/nph-zms? ... ****&pass=***********" alt="Front Door">... But I really wanna know if I can get this without use the user and pasword directily on html code since I am already have logged using the API...
Thanks and sorry about my poor english !
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Get video streaming through API

Post by asker »

If you don't want to use "user=&pass=", you can replace it by "&auth=" (better). However, doing this requires more steps:

1. You need to log into the web console of ZoneMinder. There is no API for login today, so you'll have to write code to do an "HTTP POST" to "/zm/index.php". See this for an example

2. Once you are logged in, you can use the new "getCredentials.json" API (its in master) to get the auth key. There is no documentation on it yet but this thread will give you information on how to use it


Its more complex than a stateless user=&pass= but is better
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
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Get video streaming through API

Post by snake »

This will be useful to me if the auth keys can be set to never expire. Not for security reasons, but for memory constrained devices (e.g. Arduino) that require some tricks to parse the API auth HTTP response in RAM if using username / password.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Get video streaming through API

Post by rockedge »

check out -> https://s h i n o b i.video/docs/cameras (remove the spaces, their only there to prevent auto-correction)
Locked