WarmUpTill / SceneSwitcher

An automated scene switcher for OBS Studio
https://obsproject.com/forum/resources/automatic-scene-switching.395/
GNU General Public License v2.0
914 stars 71 forks source link

Can SceneSwitcher be used to start video recording when motion is detected? #490

Closed rajhlinux closed 1 year ago

rajhlinux commented 2 years ago

Is your feature request related to a problem? Please describe. How to activate video recording when motion is detected.

Describe the solution you'd like Allow SceneSwitcher to detect motion and start video recording when motion is detected.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. None

Additional context Add any other context or screenshots about the feature request here. None

nacalai commented 2 years ago

Yea, you could use pattern match for that. Choose Video as trigger and enable pattern match. I assume it would work well. You take a screenshot of the current frame to use as the pattern and play around with sensitivity

WarmUpTill commented 2 years ago

Just to add to the comment by @nacalai:

The video condition also supports the more generic "has changed" / "has not changed" check types, which also support pattern matching so minor changes in the image will not trigger the condition. This way you will not have to provide any particular screenshot but can instead detect any changes in the image. As usual you can also add duration modifiers to the condition to specify an amount of time for which a condition needs to be true so short term changes in the image will not trigger whatever actions you have specified unexpectedly.

Here is an example: MotionDetection

Let me know if that covers what you were looking for! :)

donsenilo1968 commented 2 years ago

Hello

I've tried a few examples incl. the above, but it works not as I hoped.

I want to check my webcam for motion. If this is the case, OBS should start recording. I have done this with a macro which works, but it starts recording immediately.

Then I've created a second macro which should stop the recording if the video has not changed for the last 5 seconds. But that does not work at all. The recording never stops.

Can you help me please ?

WarmUpTill commented 2 years ago

I have done this with a macro which works, but it starts recording immediately.

You can modify the macro not not start recording immediately by adding a duration modifier to the condition triggering the recording start.

Then I've created a second macro which should stop the recording if the video has not changed for the last 5 seconds. But that does not work at all. The recording never stops.

I assume you used the "has not changed" check without any pattern matching, correct?

Be aware that even a single pixel changing will reset this condition's duration modifier in that case. As there is most likely going to be some noise when using a video camera as a source this can cause issues.

I would recommend to enable pattern matching with a very high threshold for this use case.

donsenilo1968 commented 2 years ago

Thank you for your reply.

I thought I could use it with my Kinect to start recording if motion (Stickfigure) is detected. But as you wrote there's almost all the time noise It was worth the try.