Local video creation with prebuffer using PIR/GPIO or sockets