Send Motion-user mailing list submissions to motion-user@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/motion-user or, via email, send a message with subject or body 'help' to motion-user-requ...@lists.sourceforge.net You can reach the person managing the list at motion-user-ow...@lists.sourceforge.net When replying, please edit your Subject line so it is more specific than "Re: Contents of Motion-user digest..." Today's Topics: 1. Re: Activate a screen when motion is detected (chuck elliot) 2. Re: Activate a screen when motion is detected (chuck elliot) 3. Re: Activate a screen when motion is detected (chuck elliot) ---------------------------------------------------------------------- Message: 1 Date: Fri, 28 Aug 2020 14:48:34 +0100 From: chuck elliot <c.ell...@pobox.com> To: motion-user@lists.sourceforge.net Subject: Re: [Motion-user] Activate a screen when motion is detected Message-ID: <5d3c8df8-61b8-e77c-b1ae-21d2a4850...@pobox.com> Content-Type: text/plain; charset=utf-8; format=flowed If I understand him correctly, I think our friend wants to see the normal video appear on the Pi screen but only when there is motion. The video_pipe and video_pipe_motion parameters will either show continuous normal video or the changed pixel video. That's why I suggested using the output video files as the source... Regards, CE. On 28/08/2020 1:37 am, MrDave wrote: > I think the answer you are looking for is the video_pipe option. The > following documentation provides additional details. > > https://motion-project.github.io/motion_config.html#OptDetail_Pipe > > > On 8/27/2020 2:38 PM, chuck elliot wrote: >> Could you not record video as usual but then just >> >> stream or play the video file when it arrives maybe >> >> using inotifywait -m or similar to trigger this? >> >> The delete the file once played if you like. >> >> CE. >> >> >> On 27/08/2020 8:29 pm, Massively God wrote: >>> Hello community. >>> >>> Who I am? An idiot trying to do things too complicated when I am sure >>> there is an easier way. I do have linux/raspberry/bash/python >>> experience but I am no expert on any of them. >>> >>> What do I have? Raspberry Pi Zero WH, Raspbian 10 Buster, Raspberry >>> Camera 2.1, Raspberry HDMI Touchscreen (USB connected, not GPIO), Of >>> course SD and all appropriated cables. >>> >>> What do I want to do? I want to activate the screen when motion >>> detects movement on the camera. I am not interested in recording, or >>> webstream. >>> >>> How do I want to do it? First, I wanted to activate the camera via >>> "python3 camera.startpreview()" But obviously I can't import in python >>> the camera instructions. So I created a very simple script; >>> >>> import picamera >>> import time >>> camera=picamera.PiCamera() >>> camera.start_preview() >>> time.sleep (60) >>> >>> And that is when I learned about the ENOSP error. Basically two >>> processes can not access the camera at the same time (motion and >>> python). >>> And this is where I am stucked. Unfortunately I can?t find anyone on >>> the internet who did and documented this. >>> >>> SO now I have 2 options; >>> >>> First, from motion.conf close the camera and then call the python >>> script that turns on the camera in the screen. CONS; The screen >>> backlight would be on all the time (though I am sure this has an easy >>> workaround) >>> >>> Second, have motion send a constant stream from the camera to the >>> screen and activate/deactivate the backlight with "vcgencmd >>> display_power 1/0" on event start/stop. >>> >>> Third, make a very complicated setup where motion starts streaming the >>> video in case of an event and a second process always listening and >>> showing that stream if available. CONS; It's way over my capabilities. >>> >>> Thank you very much for your support >>> >>> >>> _______________________________________________ >>> Motion-user mailing list >>> Motion-user@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/motion-user >>> https://motion-project.github.io/ >>> >>> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user >> >> >> _______________________________________________ >> Motion-user mailing list >> Motion-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/motion-user >> https://motion-project.github.io/ >> >> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user > > > _______________________________________________ > Motion-user mailing list > Motion-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/motion-user > https://motion-project.github.io/ > > Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user ------------------------------ Message: 2 Date: Fri, 28 Aug 2020 17:47:51 +0100 From: chuck elliot <c.ell...@pobox.com> To: motion-user@lists.sourceforge.net Subject: Re: [Motion-user] Activate a screen when motion is detected Message-ID: <737d5e4f-4257-29cb-3f9b-dad559d84...@pobox.com> Content-Type: text/plain; charset="utf-8"; Format="flowed" If I'm right then this should more or less achieve the desired effect: /* */ /*#!/bin/bash cd /var/motion while inotifywait -e close_write .? > ~/events do mplayer /var/motion/$(tail -n1 ~/events | sed s9'./ CLOSE_WRITE '9''9) done */ where /var/motion should be replaced with the value of "target_dir" in motion.conf*. * You ought to be able to omit the awkward use of sed but I could not get the "--format %f" option to work in the script. It would be a good idea to put a short "event_gap" value in motion.conf to improve response. The downside is that it won't show you what's going on until it's over. You could play around with trapping the MODIFY or OPEN events and and motion timing parameters if that's not what you want. Good luck, CE On 28/08/2020 2:48 pm, chuck elliot wrote: > If I understand him correctly, I think our friend wants to see the > normal video > > appear on the Pi screen but only when there is motion. > > The video_pipe and video_pipe_motion parameters will > > either show continuous normal video or the changed pixel > > video. That's why I suggested using the output video files as > > the source... > > Regards, > > CE. > > > On 28/08/2020 1:37 am, MrDave wrote: >> I think the answer you are looking for is the video_pipe option. The >> following documentation provides additional details. >> >> https://motion-project.github.io/motion_config.html#OptDetail_Pipe >> >> >> On 8/27/2020 2:38 PM, chuck elliot wrote: >>> Could you not record video as usual but then just >>> >>> stream or play the video file when it arrives maybe >>> >>> using inotifywait -m or similar to trigger this? >>> >>> The delete the file once played if you like. >>> >>> CE. >>> >>> >>> On 27/08/2020 8:29 pm, Massively God wrote: >>>> Hello community. >>>> >>>> Who I am? An idiot trying to do things too complicated when I am sure >>>> there is an easier way. I do have linux/raspberry/bash/python >>>> experience but I am no expert on any of them. >>>> >>>> What do I have? Raspberry Pi Zero WH, Raspbian 10 Buster, Raspberry >>>> Camera 2.1, Raspberry HDMI Touchscreen (USB connected, not GPIO), Of >>>> course SD and all appropriated cables. >>>> >>>> What do I want to do? I want to activate the screen when motion >>>> detects movement on the camera. I am not interested in recording, or >>>> webstream. >>>> >>>> How do I want to do it? First, I wanted to activate the camera via >>>> "python3 camera.startpreview()" But obviously I can't import in python >>>> the camera instructions. So I created a very simple script; >>>> >>>> import picamera >>>> import time >>>> camera=picamera.PiCamera() >>>> camera.start_preview() >>>> time.sleep (60) >>>> >>>> And that is when I learned about the ENOSP error. Basically two >>>> processes can not access the camera at the same time (motion and >>>> python). >>>> And this is where I am stucked. Unfortunately I can?t find anyone on >>>> the internet who did and documented this. >>>> >>>> SO now I have 2 options; >>>> >>>> First, from motion.conf close the camera and then call the python >>>> script that turns on the camera in the screen. CONS; The screen >>>> backlight would be on all the time (though I am sure this has an easy >>>> workaround) >>>> >>>> Second, have motion send a constant stream from the camera to the >>>> screen and activate/deactivate the backlight with "vcgencmd >>>> display_power 1/0" on event start/stop. >>>> >>>> Third, make a very complicated setup where motion starts streaming the >>>> video in case of an event and a second process always listening and >>>> showing that stream if available. CONS; It's way over my capabilities. >>>> >>>> Thank you very much for your support >>>> >>>> >>>> _______________________________________________ >>>> Motion-user mailing list >>>> Motion-user@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/motion-user >>>> https://motion-project.github.io/ >>>> >>>> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user >>> >>> >>> _______________________________________________ >>> Motion-user mailing list >>> Motion-user@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/motion-user >>> https://motion-project.github.io/ >>> >>> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user >> >> >> _______________________________________________ >> Motion-user mailing list >> Motion-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/motion-user >> https://motion-project.github.io/ >> >> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user > > > _______________________________________________ > Motion-user mailing list > Motion-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/motion-user > https://motion-project.github.io/ > > Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 3 Date: Fri, 28 Aug 2020 21:41:24 +0100 From: chuck elliot <c.ell...@pobox.com> To: motion-user@lists.sourceforge.net Subject: Re: [Motion-user] Activate a screen when motion is detected Message-ID: <32853baa-a0eb-5778-ffde-bdcc8b41a...@pobox.com> Content-Type: text/plain; charset="utf-8"; Format="flowed" Here's a neater version: /#!/bin/bash srcdir=/var/motion dest=~/events event=close_write,close EVENT=$(echo $event | tr [a-z] [A-Z]) while inotifywait -e $event $srcdir --format $srcdir/%f > $dest do mplayer $(tail -n1 $dest) done/ CE. On 28/08/2020 5:47 pm, chuck elliot wrote: > > If I'm right then this should more or less achieve the desired effect: > > /* > */ > > /*#!/bin/bash > > cd /var/motion > > while inotifywait -e close_write .? > ~/events > > do mplayer /var/motion/$(tail -n1 ~/events | sed s9'./ CLOSE_WRITE '9''9) > > done > > */ > > where /var/motion should be replaced with the value of "target_dir" in > motion.conf*. > * > > You ought to be able to omit the awkward use of sed but I could not get > > the "--format %f" option to work in the script. > > It would be a good idea to put a short "event_gap" value in > > motion.conf to improve response. > > The downside is that it won't show you what's going on until it's over. > > You could play around with trapping the MODIFY or OPEN events and > > and motion timing parameters if that's not what you want. > > Good luck, > > CE > > > On 28/08/2020 2:48 pm, chuck elliot wrote: >> If I understand him correctly, I think our friend wants to see the >> normal video >> >> appear on the Pi screen but only when there is motion. >> >> The video_pipe and video_pipe_motion parameters will >> >> either show continuous normal video or the changed pixel >> >> video. That's why I suggested using the output video files as >> >> the source... >> >> Regards, >> >> CE. >> >> >> On 28/08/2020 1:37 am, MrDave wrote: >>> I think the answer you are looking for is the video_pipe option. The >>> following documentation provides additional details. >>> >>> https://motion-project.github.io/motion_config.html#OptDetail_Pipe >>> >>> >>> On 8/27/2020 2:38 PM, chuck elliot wrote: >>>> Could you not record video as usual but then just >>>> >>>> stream or play the video file when it arrives maybe >>>> >>>> using inotifywait -m or similar to trigger this? >>>> >>>> The delete the file once played if you like. >>>> >>>> CE. >>>> >>>> >>>> On 27/08/2020 8:29 pm, Massively God wrote: >>>>> Hello community. >>>>> >>>>> Who I am? An idiot trying to do things too complicated when I am sure >>>>> there is an easier way. I do have linux/raspberry/bash/python >>>>> experience but I am no expert on any of them. >>>>> >>>>> What do I have? Raspberry Pi Zero WH, Raspbian 10 Buster, Raspberry >>>>> Camera 2.1, Raspberry HDMI Touchscreen (USB connected, not GPIO), Of >>>>> course SD and all appropriated cables. >>>>> >>>>> What do I want to do? I want to activate the screen when motion >>>>> detects movement on the camera. I am not interested in recording, or >>>>> webstream. >>>>> >>>>> How do I want to do it? First, I wanted to activate the camera via >>>>> "python3 camera.startpreview()" But obviously I can't import in >>>>> python >>>>> the camera instructions. So I created a very simple script; >>>>> >>>>> import picamera >>>>> import time >>>>> camera=picamera.PiCamera() >>>>> camera.start_preview() >>>>> time.sleep (60) >>>>> >>>>> And that is when I learned about the ENOSP error. Basically two >>>>> processes can not access the camera at the same time (motion and >>>>> python). >>>>> And this is where I am stucked. Unfortunately I can?t find anyone on >>>>> the internet who did and documented this. >>>>> >>>>> SO now I have 2 options; >>>>> >>>>> First, from motion.conf close the camera and then call the python >>>>> script that turns on the camera in the screen. CONS; The screen >>>>> backlight would be on all the time (though I am sure this has an easy >>>>> workaround) >>>>> >>>>> Second, have motion send a constant stream from the camera to the >>>>> screen and activate/deactivate the backlight with "vcgencmd >>>>> display_power 1/0" on event start/stop. >>>>> >>>>> Third, make a very complicated setup where motion starts streaming >>>>> the >>>>> video in case of an event and a second process always listening and >>>>> showing that stream if available. CONS; It's way over my >>>>> capabilities. >>>>> >>>>> Thank you very much for your support >>>>> >>>>> >>>>> _______________________________________________ >>>>> Motion-user mailing list >>>>> Motion-user@lists.sourceforge.net >>>>> https://lists.sourceforge.net/lists/listinfo/motion-user >>>>> https://motion-project.github.io/ >>>>> >>>>> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user >>>> >>>> >>>> _______________________________________________ >>>> Motion-user mailing list >>>> Motion-user@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/motion-user >>>> https://motion-project.github.io/ >>>> >>>> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user >>> >>> >>> _______________________________________________ >>> Motion-user mailing list >>> Motion-user@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/motion-user >>> https://motion-project.github.io/ >>> >>> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user >> >> >> _______________________________________________ >> Motion-user mailing list >> Motion-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/motion-user >> https://motion-project.github.io/ >> >> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user > > > _______________________________________________ > Motion-user mailing list > Motion-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/motion-user > https://motion-project.github.io/ > > Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ ------------------------------ Subject: Digest Footer _______________________________________________ Motion-user mailing list Motion-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/motion-user ------------------------------ End of Motion-user Digest, Vol 170, Issue 24 ********************************************