mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Skip repeated segment in stream recorder (#46701)
* Skip repeated segment in stream recorder * Allow for multiple overlap
This commit is contained in:
parent
a5ac338c74
commit
3c7db7bd5b
@ -42,7 +42,14 @@ def recorder_save_worker(file_out: str, segments: List[Segment], container_forma
|
||||
)
|
||||
source.close()
|
||||
|
||||
last_sequence = float("-inf")
|
||||
for segment in segments:
|
||||
# Because the stream_worker is in a different thread from the record service,
|
||||
# the lookback segments may still have some overlap with the recorder segments
|
||||
if segment.sequence <= last_sequence:
|
||||
continue
|
||||
last_sequence = segment.sequence
|
||||
|
||||
# Open segment
|
||||
source = av.open(segment.segment, "r", format=container_format)
|
||||
source_v = source.streams.video[0]
|
||||
|
Loading…
x
Reference in New Issue
Block a user