The key to using this software from other systems is the command PIPE that the web software uses to send commands to the underlying raspimjpeg process.budman1758 wrote: ↑Fri Oct 27, 2017 5:51 pmFirst off... Great software here!! Kudos to the folks who make it possible!! I searched a while and my answer is probably somewhere in these 4000+ posts but it still eludes me.
I am looking for the easiest way to trigger recording with either a command sent via http from another computer or using a gpio on the camera unit itself. I am wanting to record at night using infrared floodlights. I'm using the noir camera boards in a dummy camera housing and making my own surveillance system . I need to be able to start and stop the recording externally so the camera will see what caused the pir sensor to trigger (using the circular buffer). I have external pir sensors that control ir floodlights. I just need a simple solution for this.
My programming skills are pretty much zero so hopefully there is a not too difficult way to make this work. Thanks for any help.
The PIPE looks just like a file to be written to and is called FIFO in the folder where the web software is installed (e.g. /var/www/html/FIFO).
The commands are documented in the wiki and there is a summary in the scheduler settings web page.
For your purposes you will want the ca command (capture video). One can either start video with ca 1 and stop it with ca 0 or one can do a timed recording of a number of seconds by using an extra parameter. E.g. ca 1 30 would do a 30 second recording.
These commands can be sent from any other process. To try it out you can send them easily from a command line. Open up a terminal window and
Code: Select all
echo 'ca 1 30' >/var/www/html/FIFO
If you want to trigger this from a GPIO then you will need a little program or script that senses the change in GPIO and then sends this command in. This can either be in a bash command line script or a little python program.
I am not quite sure what you want when you say http from another machine. If you mean from say a web page with a capture button on it then the simplest way would be to just use the same type of scheme as used on the current web page. If you mean you want to make a http request then doing something like
Code: Select all