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)


----------------------------------------------------------------------

Message: 1
Date: Fri, 28 Aug 2020 21:54:49 +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: <cb9a7c19-02bc-1741-5c18-fc02e0be1...@pobox.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

... of course you can use the arrival of a file to trigger via inotifywait

another action such as your python script to turn on the camera...

open or modify might then be better trigger events.

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...

------------------------------

Message: 2
Date: Sat, 29 Aug 2020 02:58:40 +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: <76411b13-62ef-20d3-ea0e-6eb43bc11...@pobox.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

...then again, you could use motion's on_motion_detected (doh!)

or on_movie_start and on_movie_stop with v4l2-loopback

CE (re-inventor of the wheel)



On 28/08/2020 9:54 pm, chuck elliot wrote:
>
> ... of course you can use the arrival of a file to trigger via inotifywait
>
> another action such as your python script to turn on the camera...
>
> open or modify might then be better trigger events.
>
> 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
>
>
> _______________________________________________
> 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 25
********************************************

Reply via email to