Sensor timer logic

I would like a timer that works like this for an IP camera:
Someone walks in the room, a sensor detects movement and the timer kicks in for 60 seconds. While there is activity in the room, I want the timer to extend every 60 seconds , bt then when the sensor detects no activity for 60 seconds, the timer stops.

Can anyone help with this?

similar case:

Another approach (outside of openHAB) could be to use software that only provides video when the camera detects motion:

Works great so far …

see Design Pattern for general pattern to intercept rule actions at runtime. The detailed example involves motion detector and a light, but you could substitute your IP camera for the light.

Thanks guys the camera side of it is a bit of a curve ball as this is managed via changing panels in habpanel based on the value of an item which is what I want to change when the pir goes on or off after a period. I had a rule but I think it was firing many instances of a timer and ten the pir went to ON. The default example was all I needed - works well!