Page 1 of 1
Interacting with an IP Camera
Posted: Wed Dec 09, 2020 10:03 pm
by simon.schvartzman
Greetings, I wonder if someone has experience (and ideally a stack to share) interacting with one of those popular Interact / IP Cameras.
There are several, relatively cheap, so called IP Cameras (example
https://www.vstarcam.com/support/) that are controlled by a propiatary APP and/or are able to upload the image stream to the cloud. In my case what I'd like to do is to control one of such cameras from a LC App and instead of getting the full image stream I'd like to grab an image snapshot as a response of a command issued by the LC APP.
Many of those cameras support a protocol called ONVIF and last year there was a post (with no answer) about it ...
viewtopic.php?f=7&t=33030&p=182518&hilit=onvif#p182518
Any ideas/suggestions?
As always many thanks in advance...
Re: Interacting with an IP Camera
Posted: Wed Dec 09, 2020 11:57 pm
by FourthWorld
What sort of control over the device are you looking for?
Are you looking to manage the device remotely (on/off, tilt, zoom, etc.), or to capture the stream?
I would imagine the control protocols would be accomplishable with reasonable effort, depending on how they handle security.
Capturing the stream is probably not something you want to take on, and certainly not in a scripting language. Stream codecs are complex, and often patent-encumbered with steep licensing fees. If you're after stream capture it may be best to consider LC in a supporting role integrating with an app dedicated to that purpose.
Re: Interacting with an IP Camera
Posted: Thu Dec 10, 2020 12:54 am
by matthiasr
Simon,
without more information about how to communicate with the camera it is very difficult.
I am pretty sure you've already had a look at the examples at
https://www.onvif.org/resources/.
I've used there the link to the VBS ONVIF Scripting tools at
https://github.com/mrrekcuf/ONVIF-scripting-tools
and had a quick look at some of the scripts. It looks like it should be possible to do this with LC, but it seems to be hard work. A documented api would be much better.
But what i could see so far in the .vbs is that the request has to be done as POST and before posting your request to the camera you have to set the requestHeaders first. I would try to "convert" one of the smaller .vbs scripts for testing if i were you. For example the
onvifQuery.vbs
Re: Interacting with an IP Camera
Posted: Thu Dec 10, 2020 3:00 pm
by simon.schvartzman
Hi team, many thanks for the replies.
@FourthWorld, as you expected I don't want to capture the whole stream, I just want to remotely be able to capture a snapshot of the image.
@matthiasr, your suggested approach makes sense to me but as you said it will be a hard work and I'm not sure is worth but I will probably will give it a try...
I'm considereing a much simpler approach, let me know what you think about (I don't have a camera available at the moment to run a quick and dirty test)...
Since the stream of these cameras can be reached through a standard URL I'm thinking about using LC's Browser Widget and then capture (and manipulate) the Browser output. Any downsides on such approach?
Best
Re: Interacting with an IP Camera
Posted: Thu Dec 10, 2020 3:05 pm
by matthiasr
Since the stream of these cameras can be reached through a standard URL I'm thinking about using LC's Browser Widget and then capture (and manipulate) the Browser output. Any downsides on such approach?
If LC is able to capture the content of the browser widget (i am currently not sure if that is working), then this would really be the easiest and fastest way to get it working.
Give it a try and let us know.
All the best.
Matthias
Re: Interacting with an IP Camera
Posted: Thu Dec 10, 2020 4:50 pm
by simon.schvartzman
Matthias as you suspected it doesn't work
I created a group with a button and the browser
and then took a snapshot of the group
Code: Select all
export snapshot from group "Grupo" to file "screen.jpg" as JPEG
The file is created but is just a black screen with the button

- screen.jpg (4.34 KiB) Viewed 20945 times
Any better ideas?
Re: Interacting with an IP Camera
Posted: Thu Dec 10, 2020 4:55 pm
by matthiasr
I am not sure if this is working, but you could call the macOS command line tool screencapture to capture the the stack/card.
Here's a little overview.
https://osxdaily.com/2011/08/11/take-sc ... -mac-os-x/
There are much more flags available. You can define the screenarea for example or the windowid and so on.
Regards,
Matthias
Re: Interacting with an IP Camera
Posted: Thu Dec 10, 2020 5:02 pm
by matthiasr
In an other forum thread someone wrote that
export snapshot from rect would work for him. Post #2 at
viewtopic.php?t=28384
I just tried it and it definitely works.
Code: Select all
export snapshot from rect (the rect of widget "browser") to file "~/desktop/File1.png" as PNG
So you can do it with LC without external tool.
Regards,
Matthias
Re: Interacting with an IP Camera
Posted: Thu Dec 10, 2020 6:24 pm
by simon.schvartzman
Indeed it works, great! Many thanks.
Regards