Set export sub process to be lower priority (#7862)

This commit is contained in:
Nicolas Mowen 2023-09-21 04:22:35 -06:00 committed by GitHub
parent 8728139ae3
commit 3797340efa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,10 @@ from frigate.ffmpeg_presets import (
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def lower_priority():
os.nice(10)
class PlaybackFactorEnum(str, Enum): class PlaybackFactorEnum(str, Enum):
realtime = "realtime" realtime = "realtime"
timelapse_25x = "timelapse_25x" timelapse_25x = "timelapse_25x"
@ -86,6 +90,7 @@ class RecordingExporter(threading.Thread):
ffmpeg_cmd, ffmpeg_cmd,
input="\n".join(playlist_lines), input="\n".join(playlist_lines),
encoding="ascii", encoding="ascii",
preexec_fn=lower_priority,
capture_output=True, capture_output=True,
) )