motioneye-project/motioneye

Trigger recording from outside Motion(eye)

Closed this issue · 14 comments

Hello @ccrisan

after a long time I've come back to give a try to Motion Eye and I like it a lot, when running on my Debian machine. Yet, since I am using more than a hand full of cameras, I cannot use software based motion detection as it is a) far too unreliable and b) it eats up all my CPU already with 2-3 cameras.

Hence, I've recently been playing with using my home automation motion sensors to trigger recording, by calling a URL. I've tried it with Zoneminder and it worked quite well, as they offer http URLs that can be used to start and stop recording (web-triggered recording they call it). Yet, Zoneminder was far too fat and the lack of recording movies instead of .jpgs makes it no feasible solution for me (hard disk runs full after a day of recording and the filesystem goes crazy).

I'd like to use Motioneye for that purpose, but I've not been able neither by using Google nor Github search to find how to trigger recording externally.

Is there any API to motioneye that allows it? Can I trigger and stop recording from a camera by calling an API? I've seen that I can see the stream of camera 1 via http://server:8081 - so a http://server:8081?recording=[start|stop] would be a great way to control recording.

Yet, I am afraid this is not the case, and hence I'd then add this as feature request which would make Motioneye really a superior system, that then can be integrated with more reliable motion sensors than software based motion-detection is (and this is also much more energy efficient and saves the environment :-)).

I second this request!

I third. This is the one reason I can't use motioneye. Could really use a way to trigger a recording. Start/stop might be problematic in case a call fails, especially with sensors that don't report an "off" event for motion. Instead, I would suggest:

http://server:8765/capture?camara=NAME&duration=DURATION

Where NAME is the name of the camera and DURATION is the number of seconds to record.

After some more investigation, this may not be possible due to the limitations of how the daemon motion works. Oh well.

Can't you use motion's webcontrol HTTP interface to trigger the recording? #31 (comment)

Hey I set this up yesterday FYI

Start motion recording:
curl "http://localhost:7999/1/config/set?emulate_motion=1
Disable motion recording:
curl "http://localhost:7999/1/config/set?emulate_motion=0

@dtbaker That's great! We just installed the docker container. Motion and motion eye are great! Much better than zoneminder. We tried shinobi as well, but not happy with it.

However, what I wanted to say is that starting motion recording with this get request seems to work perfectly. Thank you!

Does anyone know if starting a recording this way triggers the motion notification section of motionEye???

This also puzzles me. It's brilliant piece of software. I read that everywhere. However, once installed, I had a question. How do you actually make it work?

What do you mean, 'make it work'?
What do you want it to do?
1st, you install it to SDCard (or if using dev20201026 a USB Thumb Drive)
2nd, you copy the ssh or ssh.txt file and wpa_supplicant.conf file to the /boot partition
3rd, you insert the SDCard or Thumb drive into a Pi (or similar supported SBC)
4th, you connect to the WebGUI at http://[ip_address]
5th, you add IP Cameras, or USB Web Cameras, or CSI PiCams to the system
6th, you set up where you want the files saved (locally, NAS, GDrive or Dropbox among options)
7th, you set up how sensitive you want motion detection, whether to do snap shots, videos, what format videos, etc.
8th, enjoy.
The above curl commands talk directly to motion, the back end recording program. motionEye is the front end graphical user interface, to make most options easier to set.
In the other ticket/issue, I mentioned you could use the Action Buttons to call scripts. you could create those scripts and use those commands in them...
Without knowing anything about programing you could use motion/motionEye or motionEyeOS and never even look at the underlying system, like a plug'n'play home NVR security system.

I, also, am 60 y/o, and support motioneye & motionEyeOS for free as a volunteer, and beta test other apps as requested.
I have a nice selection of hardware & software to test other's setups (like yourself) to reproduce issues for the programmers and developers.
The indicator that motion has triggered recording is a red outline box around the video, and/or if you turned on Show Frame Changes in Settings, Motion Detection
I am willing to sit here day after day walking users with issues through learning how to use products (witness the longer threads over the past 18 months here and in the motionEyeOS github). I make/made my living as an Enterprise Third Level Help Desk & Systems Administrator for M$ and Linux. If my end user is willing to learn, I will sit on the other end of the log all day long. M$ is one company, who controls their environment, and will tell you in a heartbeat to go to the 3rd party product support. Linux has a few companies, but nothing like Apple & M$, thousands of flavors of desktops and servers, hundreds of thousands of applications, and millions of users that love the freedom to pick and choose.
Be that as it may, with the hostility you are showing, I will close and lock this conversation.