mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-06-21 03:41:55 +03:00
Add metadata for creation time to recording segments and exports (#23239)
Some checks failed
CI / AMD64 Build (push) Has been cancelled
CI / ARM Build (push) Has been cancelled
CI / Jetson Jetpack 6 (push) Has been cancelled
CI / AMD64 Extra Build (push) Has been cancelled
CI / ARM Extra Build (push) Has been cancelled
CI / Synaptics Build (push) Has been cancelled
CI / Assemble and push default build (push) Has been cancelled
Some checks failed
CI / AMD64 Build (push) Has been cancelled
CI / ARM Build (push) Has been cancelled
CI / Jetson Jetpack 6 (push) Has been cancelled
CI / AMD64 Extra Build (push) Has been cancelled
CI / ARM Extra Build (push) Has been cancelled
CI / Synaptics Build (push) Has been cancelled
CI / Assemble and push default build (push) Has been cancelled
This commit is contained in:
parent
0013555528
commit
26d31300e6
@ -235,7 +235,17 @@ class RecordingExporter(threading.Thread):
|
|||||||
|
|
||||||
# add metadata
|
# add metadata
|
||||||
title = f"Frigate Recording for {self.camera}, {self.get_datetime_from_timestamp(self.start_time)} - {self.get_datetime_from_timestamp(self.end_time)}"
|
title = f"Frigate Recording for {self.camera}, {self.get_datetime_from_timestamp(self.start_time)} - {self.get_datetime_from_timestamp(self.end_time)}"
|
||||||
ffmpeg_cmd.extend(["-metadata", f"title={title}"])
|
creation_time = datetime.datetime.fromtimestamp(
|
||||||
|
self.start_time, tz=datetime.timezone.utc
|
||||||
|
).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
|
||||||
|
ffmpeg_cmd.extend(
|
||||||
|
[
|
||||||
|
"-metadata",
|
||||||
|
f"title={title}",
|
||||||
|
"-metadata",
|
||||||
|
f"creation_time={creation_time}",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
ffmpeg_cmd.append(video_path)
|
ffmpeg_cmd.append(video_path)
|
||||||
|
|
||||||
@ -326,7 +336,17 @@ class RecordingExporter(threading.Thread):
|
|||||||
|
|
||||||
# add metadata
|
# add metadata
|
||||||
title = f"Frigate Preview for {self.camera}, {self.get_datetime_from_timestamp(self.start_time)} - {self.get_datetime_from_timestamp(self.end_time)}"
|
title = f"Frigate Preview for {self.camera}, {self.get_datetime_from_timestamp(self.start_time)} - {self.get_datetime_from_timestamp(self.end_time)}"
|
||||||
ffmpeg_cmd.extend(["-metadata", f"title={title}"])
|
creation_time = datetime.datetime.fromtimestamp(
|
||||||
|
self.start_time, tz=datetime.timezone.utc
|
||||||
|
).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
|
||||||
|
ffmpeg_cmd.extend(
|
||||||
|
[
|
||||||
|
"-metadata",
|
||||||
|
f"title={title}",
|
||||||
|
"-metadata",
|
||||||
|
f"creation_time={creation_time}",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
return ffmpeg_cmd, playlist_lines
|
return ffmpeg_cmd, playlist_lines
|
||||||
|
|
||||||
|
|||||||
@ -547,6 +547,8 @@ class RecordingMaintainer(threading.Thread):
|
|||||||
"copy",
|
"copy",
|
||||||
"-movflags",
|
"-movflags",
|
||||||
"+faststart",
|
"+faststart",
|
||||||
|
"-metadata",
|
||||||
|
f"creation_time={start_time.strftime('%Y-%m-%dT%H:%M:%S.%fZ')}",
|
||||||
file_path,
|
file_path,
|
||||||
stderr=asyncio.subprocess.PIPE,
|
stderr=asyncio.subprocess.PIPE,
|
||||||
stdout=asyncio.subprocess.DEVNULL,
|
stdout=asyncio.subprocess.DEVNULL,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user