From 3716562bcc7ab9205792f20ca144d43e2bc73221 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 2 Mar 2024 14:42:36 +0000 Subject: [PATCH] e --- unifi/cams/base.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/unifi/cams/base.py b/unifi/cams/base.py index 15954bd..023e719 100644 --- a/unifi/cams/base.py +++ b/unifi/cams/base.py @@ -901,11 +901,11 @@ class UnifiCamBase(metaclass=ABCMeta): def get_base_ffmpeg_args(self, stream_index: str = "") -> str: base_args = [ - # "-avoid_negative_ts", - # "make_zero", + "-avoid_negative_ts", + "make_zero", # "-fflags", - # "+genpts+discardcorrupt", - # "-use_wallclock_as_timestamps 1", + "+genpts", + "-use_wallclock_as_timestamps 1", ] # try: @@ -942,7 +942,10 @@ class UnifiCamBase(metaclass=ABCMeta): f" {self.get_base_ffmpeg_args(stream_index)}" f' -i "{source}"' f" {self.get_extra_ffmpeg_args(stream_index)}" - f" -metadata streamName={stream_name} -f flv - | nc {destination[0]} {destination[1]}" + f" -metadata streamName={stream_name} -f flv -" + f" | {sys.executable} -m unifi.clock_sync" + f" {'--write-timestamps' if self._needs_flv_timestamps else ''}" + f" | nc {destination[0]} {destination[1]}" )