When motion is detected then an macro (motion_event.sh in the macros folder) is run if it is present. That, in principle, can do whatever you want.rpiuser2016 wrote: ↑Wed Mar 21, 2018 12:16 pmIs it possible to trigger sound alarm or red blinking of any part of screen in webinterface then motion is detected?
Code: Select all
start monitoring for pid: 1991
{2018/04/05 02:31:15} start monitoring for pid: 1991
RaspiMJPEG Version 5.8.10
recommended video buffer size 65536
h264 size set to 131072
recommended video buffers 1
h264 buffers set to recommended 1
Opening FIFO 0 /var/www/html/FIFO 7
Opening FIFO 1 /var/www/html/FIFO11 8
MJPEG streaming, ready to receive commands
send smd 9Code: Select all
Starting command loop
Capturing imageThey are a little bit coupled but not tightly.jimonline wrote: ↑Wed Apr 04, 2018 7:08 pmHi, I'm trying to use raspimjpeg as a standalone executable and found that it's tightly coupled with schedule.php file, here's what I have done and have observed.
1. Installed RPi Cam Web Interface without any issue and could get all functions up and running in Chrome. Then I tried to use raspimjpeg as a standalone executable.
2. Login with pi user
3. Run sudo su -c 'raspimjpeg' www-data, the output is4. Opened another terminal and run echo -n "im" > /var/www/html/FIFO, the command executed without any error, but 1) raspimjpeg output didn't change at all and 2) there was no image captured in /var/www/html/media.Code: Select all
start monitoring for pid: 1991 {2018/04/05 02:31:15} start monitoring for pid: 1991 RaspiMJPEG Version 5.8.10 recommended video buffer size 65536 h264 size set to 131072 recommended video buffers 1 h264 buffers set to recommended 1 Opening FIFO 0 /var/www/html/FIFO 7 Opening FIFO 1 /var/www/html/FIFO11 8 MJPEG streaming, ready to receive commands send smd 9
5. Run sudo su -c 'php /var/www/html/schedule.php > /dev/null &' www-data, after issuing the command, the raspimjpeg output had two new linesMy question is: what did schedule.php do to have raspimjpeg start the command loop (before executing schedule.php, raspimjpeg seemed not starting the command loop) and how should I get rid of schedule.php and still allow raspimjpeg to run correctly?Code: Select all
Starting command loop Capturing image
BTW, raspimjpeg is by far the only solution I can find with such low latency when streaming video to browsers, it's REALLY a great project. Great job folks.
Code: Select all
motion_pipeCode: Select all
motion_pipe /var/www/html/FIFO1Worked like a charm! Thank you btidey!btidey wrote: ↑Thu Apr 05, 2018 11:46 amThey are a little bit coupled but not tightly.
What you are seeing is that when raspimjpeg starts up its sends a cmd 9 to the scheduler via the FIFO1 which is where the scheduler receives things like motion detect commands. cmd 9 is used to reset the scheduler and allows it to get into sync with its schedule and do things like period change commands etc. If FIFO1 is not set up and active then raspimjpeg stalls as there is no extra detection on that. As soon as you start up the scheduler then FIFO1 becomes active and it proceeds.
You can set up FIFO1 independently of scheduler if you want to get and handle things like motion detects from raspimjpeg. This would allow raspimjpeg to start up OK.
If you are not interested in the motion detect then you can disable raspimjpeg from trying to use FIFO1 altogether by setting motion_pipe in /raspimjpeg to empty.
instead ofCode: Select all
motion_pipeCode: Select all
motion_pipe /var/www/html/FIFO1
The raspimjpeg github uses a fork of the raspberry userland as an environment to compile from and have all the MMAL references etc. The only extra commits we add are in the userland/host_applications/linux/apps/raspicam/ part where the raspimjpeg source is.jimonline wrote: ↑Thu Apr 05, 2018 1:54 pm
Worked like a charm! Thank you btidey!
Another question: I found on the raspimjpeg github site https://github.com/roberttidey/userland saying that "This branch is 95 commits ahead, 189 commits behind raspberrypi:master. ", as a .NET background developer I don't know if there is any DLL hell situation in C world in this case, meaning that whether raspimjpeg depends on some other components which have been updated in the raspberrypi:master branch, or the compiler just statically linked all dependencies into raspimjpeg executable. Will there be a plan to merge two branches?
What max_capture does is to simulate a motion end signal after this interval if a video recording started by a motion start trigger lasts longer than this. Note this is just the motion end signal. For it to have an effect then there must be something in the scheduler Motion End command set up.CharlyDelta wrote: ↑Sat Apr 07, 2018 1:37 pmHi..
How to set the video recordings to not exceed 20 seconds with one second between each event?
I entered 20 in Max_Capture without success
Thanks for your help
You can access the mjpeg stream outside of the web interface by using the same url the web interface uses.stevendom57 wrote: ↑Sat Apr 07, 2018 6:50 pmI would like to set up my RPi cam using this and then use it in Home Assistant (a freeware home automation package). Is there a mjpeg stream available to directly connect to without using the html front end?
TIA
Steven
Code: Select all
http://ip/html/cam_pic_new.php?pDelay=400001) /dev/shm/ is a temporary folder set up in RAM so there is no SD card wear involved. That is why cam.jpg is written there and links used. Same with status file.speedAmaster wrote: ↑Sun Apr 08, 2018 9:20 pmnewbie questions:
1) is RPi-Cam-Web-Interface killing my SD-card by constantly writing new still images to /dev/shm/mjpeg/cam.jpg ?
2) wanted to use the still images to feed my FritzBox (only takes snapshots.... jpg. WHat would be the url I could use like: http://myPi:8080/cam.jpg ?
You can obviously create a browser shortcut on your phone to give direct access without going through the browser.
@btidey: great to hear about in RAM execution.btidey wrote: ↑Mon Apr 09, 2018 8:13 am1) /dev/shm/ is a temporary folder set up in RAM so there is no SD card wear involved. That is why cam.jpg is written there and links used. Same with status file.speedAmaster wrote: ↑Sun Apr 08, 2018 9:20 pmnewbie questions:
1) is RPi-Cam-Web-Interface killing my SD-card by constantly writing new still images to /dev/shm/mjpeg/cam.jpg ?
2) wanted to use the still images to feed my FritzBox (only takes snapshots.... jpg. WHat would be the url I could use like: http://myPi:8080/cam.jpg ?
2) That url will work if you are using port 8080, installed direct into /var/www rather than subfolder, and allowed the jpglink in the install. The jpglink determines whether cam.jpg is available as a direct linked file. I prefer to use http://myPi:8080/cam_pic.php which will achieve the same thing