fix(lab): make recorded replay seek-safe
This commit is contained in:
@@ -48,7 +48,8 @@ from k1link.viewer.recorded import (
|
||||
from k1link.viewer.rerun_bridge import RerunSceneSettings
|
||||
|
||||
DEFAULT_REPLAY_ACTION_ID = "stream.start-replay"
|
||||
RECORDED_MEDIA_STREAM_MANIFEST_SCHEMA = "missioncore.observation-recorded-media/v3"
|
||||
RECORDED_MEDIA_STREAM_MANIFEST_SCHEMA = "missioncore.observation-recorded-media/v4"
|
||||
RECORDED_PERCEPTION_STREAM_MANIFEST_SCHEMA = "missioncore.observation-recorded-media/v3"
|
||||
SAFE_SOURCE_ID = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$")
|
||||
SAFE_SHA256 = re.compile(r"^[a-f0-9]{64}$")
|
||||
MAX_SAFE_INTEGER = 9_007_199_254_740_991
|
||||
@@ -1706,7 +1707,7 @@ def _recorded_perception_manifest_document(
|
||||
encoded_result_id = quote(video.result_id, safe="")
|
||||
base = f"/api/v1/observation-sessions/{encoded_session_id}/perception-media/{encoded_result_id}"
|
||||
return {
|
||||
"schema_version": RECORDED_MEDIA_STREAM_MANIFEST_SCHEMA,
|
||||
"schema_version": RECORDED_PERCEPTION_STREAM_MANIFEST_SCHEMA,
|
||||
"source_id": video.public_source_id,
|
||||
"generation_sha256": video.sha256,
|
||||
"byte_length": video.byte_length,
|
||||
@@ -1795,6 +1796,13 @@ def _recorded_media_manifest_document(
|
||||
"media_type": epoch.media_type,
|
||||
"byte_length": epoch.init_byte_length
|
||||
+ sum(segment.byte_length for segment in epoch.segments),
|
||||
"segment_count": len(epoch.segments),
|
||||
"random_access_sequences": sorted(
|
||||
segment.sequence for segment in epoch.segments if segment.random_access
|
||||
),
|
||||
"segment_end_times_seconds": [
|
||||
segment.end_time_seconds for segment in epoch.segments
|
||||
],
|
||||
"stream_url": (
|
||||
f"{base}/epochs/{epoch.ordinal}/recording.mp4"
|
||||
f"?generation={manifest.generation_sha256}"
|
||||
|
||||
Reference in New Issue
Block a user