elsampsa / valkka-live

OpenSource Video Surveillance Program
GNU Affero General Public License v3.0
31 stars 12 forks source link

Add ptz keyboard controls #8

Closed NeverOddOrEven closed 4 years ago

NeverOddOrEven commented 4 years ago

Hey @elsampsa. This isn't ready for merging, but I wanted to get your feedback on it before I spend more time on it. Do you have any thoughts on how you want PTZ controls to work?

elsampsa commented 4 years ago

Hi,

Thanks for your effort. This is very cool!

How to do the PTZ in the GUI, you're definitely on the right track..!

How it is done under-the-hood, I'm afraid it's gonna be a bit more complicated. The thing is, that there shouldn't be any blocking i/o calls in the Qt Python code. Such blocking calls will freeze the UI. The onvif calls fall into this category.

I was thinking there would be a QThread (simple) or a python multiprocess (more complex) per camera. Such thread/process would then manage the soap / onvif instance & the main program would be sending qt signals to the thread/process.

Please do experiment with your current approach as well / feel free to try the QThread approach.

I'm very busy at the moment, but I'll try to merge your changes (both this one and the other) during next weekend as the latest.

If you need a lifetime LGPL license for libValkka, etc. stuff, that can be arranged. :)

elsampsa commented 4 years ago

(woops, accidentally closed the reques, now its open again)

NeverOddOrEven commented 4 years ago

Thanks for the feedback @elsampsa. It's been a long time since I last played with Qt, but I think I can manage the changes needed. I will try the threading approach first.

Quick question. To get this working, I first had to pip3 install zeep and lxml. Is it sufficient to list them in the setup.py, or should they be installed by the valkka-core library?

elsampsa commented 4 years ago

If you take a look at here, you see that valkka.onvif namespace.

That namespace/subpackage comes with the valkka-core package you install using sudo apt-get. All onvif wsdl files also come bundled with the valkka-core package.

I suggest you proceed as described in that page. That's the most elegant way to do onvif for me .. and I have been thinking about these things several years now. :)

elsampsa commented 4 years ago

Merged to master now.

I added a sketch of how to do the onvif the right way, using QThreads. Feel free to continue, following the leads.

To see them, please give this command:

ag --python "onvif"
NeverOddOrEven commented 4 years ago

Thanks @elsampsa. Life lately has been very busy! I'm going to look at this today, and once the PTZ work is squared away, I will be turning my attention to the computer vision kernels. I'll open a new issue to discuss.