From 047567f3874931343211b680fc1b82ce0221e567 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Thu, 29 Dec 2022 16:20:47 -0700 Subject: [PATCH] Delete pipe file if it exists --- frigate/output.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frigate/output.py b/frigate/output.py index b64611bfb3..6d2c7177b3 100644 --- a/frigate/output.py +++ b/frigate/output.py @@ -39,6 +39,9 @@ def __init__( birdseye_rtsp: bool = False, ): if birdseye_rtsp: + if os.path.exists(BIRDSEYE_PIPE): + os.remove(BIRDSEYE_PIPE) + os.mkfifo(BIRDSEYE_PIPE, mode=0o777) stdin = os.open(BIRDSEYE_PIPE, os.O_RDONLY | os.O_NONBLOCK) self.bd_pipe = os.open(BIRDSEYE_PIPE, os.O_WRONLY) @@ -96,7 +99,6 @@ def read(self, length): def exit(self): if self.bd_pipe: os.close(self.bd_pipe) - os.remove(BIRDSEYE_PIPE) self.process.terminate() try: