I already have a web server set up with NGINX showing a live webcam feed from the mjpg streamer as part of a laser tag game where the idea is for the user to be able to view a live camera stream by going to a local website. However, at this stage I would like to add motion detection capabilities by using the motion package, as shown here to process the mjpg live stream.
Is there a shell command (maybe even to start a python script, etc.) which could communicate real-time (AJAX setup on the web server?) to the live HTML page showing the live camera feed running on the client device?
I would really appreciate it if you could answer my question and help me with this issue! Thanks for taking the time to read the question!
Ok, so I've been doing some research, and I believe (but I am not completely sure) that a publish-subscribe API could work for my purposes. I found PubNub to be a popular for real-time communication. I have also found some people using it with the Raspberry Pi like in this example (I am comfortable with C programming so I would prefer to use it to work with PubNub).
I have not completely solved the problem yet, so I am curious to see if others would have any thoughts on how to implement this.