pub trait LocalAsyncVideoService<I, O> {
type GetPlaylistBody: LocalAsyncWriteBody<O> + 'static;
type GetPlaylistInBoundsBody: LocalAsyncWriteBody<O> + 'static;
type GetPlaylistInBoundsV2Body: LocalAsyncWriteBody<O> + 'static;
type GetPlaylistV2Body: LocalAsyncWriteBody<O> + 'static;
Show 28 methods
// Required methods
fn get(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<Video, Error>>;
fn batch_get(
&self,
auth_: BearerToken,
request: GetVideosRequest,
) -> impl Future<Output = Result<GetVideosResponse, Error>>;
fn search(
&self,
auth_: BearerToken,
request: SearchVideosRequest,
) -> impl Future<Output = Result<SearchVideosResponse, Error>>;
fn create(
&self,
auth_: BearerToken,
request: CreateVideoRequest,
) -> impl Future<Output = Result<Video, Error>>;
fn update_metadata(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: UpdateVideoMetadataRequest,
) -> impl Future<Output = Result<Video, Error>>;
fn update_ingest_status(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: UpdateIngestStatus,
) -> impl Future<Output = Result<(), Error>>;
fn get_ingest_status(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<DetailedIngestStatus, Error>>;
fn batch_get_ingest_status(
&self,
auth_: BearerToken,
video_rids: BTreeSet<VideoRid>,
) -> impl Future<Output = Result<BTreeMap<VideoRid, DetailedIngestStatus>, Error>>;
fn get_enriched_ingest_status(
&self,
auth_: BearerToken,
request: GetEnrichedVideoIngestStatusRequest,
) -> impl Future<Output = Result<Option<EnrichedVideoIngestStatus>, Error>>;
fn archive(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<(), Error>>;
fn unarchive(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<(), Error>>;
fn get_playlist(
&self,
auth_: BearerToken,
video_rid: VideoRid,
start: Option<String>,
end: Option<String>,
) -> impl Future<Output = Result<Self::GetPlaylistBody, Error>>;
fn get_segment_summaries(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<Vec<SegmentSummary>, Error>>;
fn get_playlist_in_bounds(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: GetPlaylistInBoundsRequest,
) -> impl Future<Output = Result<Self::GetPlaylistInBoundsBody, Error>>;
fn get_playlist_in_bounds_v2(
&self,
auth_: BearerToken,
request: GetPlaylistInBoundsForChannelRequest,
) -> impl Future<Output = Result<Self::GetPlaylistInBoundsV2Body, Error>>;
fn get_playlist_v2(
&self,
auth_: BearerToken,
data_source_rid: Option<DataSourceRid>,
asset_rid: Option<AssetRid>,
data_scope_name: Option<String>,
channel: String,
tags: Option<String>,
start: String,
end: String,
) -> impl Future<Output = Result<Self::GetPlaylistV2Body, Error>>;
fn get_segment_summaries_in_bounds(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: GetSegmentSummariesInBoundsRequest,
) -> impl Future<Output = Result<Vec<SegmentSummary>, Error>>;
fn get_segment_summaries_in_bounds_v2(
&self,
auth_: BearerToken,
request: GetSegmentSummariesInBoundsForChannelRequest,
) -> impl Future<Output = Result<Vec<SegmentSummaryV2>, Error>>;
fn get_segment_metadata_v2(
&self,
auth_: BearerToken,
request: GetSegmentMetadataForChannelRequest,
) -> impl Future<Output = Result<Option<VideoChannelSegmentsMetadata>, Error>>;
fn get_segment_by_timestamp_v2(
&self,
auth_: BearerToken,
request: GetSegmentByTimestampV2Request,
) -> impl Future<Output = Result<Option<SegmentV2>, Error>>;
fn get_segment_at_or_after_timestamp(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: GetSegmentAtOrAfterTimestampRequest,
) -> impl Future<Output = Result<Option<Segment>, Error>>;
fn get_file_summaries(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: GetFileSummariesRequest,
) -> impl Future<Output = Result<GetFileSummariesResponse, Error>>;
fn generate_whip_stream(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<GenerateWhipStreamResponse, Error>>;
fn generate_whep_stream(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<Option<GenerateWhepStreamResponse>, Error>>;
fn get_stream(
&self,
auth_: BearerToken,
video_rid: VideoRid,
stream_id: String,
) -> impl Future<Output = Result<Option<VideoStream>, Error>>;
fn get_streams_in_bounds(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: GetStreamsInBoundsRequest,
) -> impl Future<Output = Result<GetStreamsInBoundsResponse, Error>>;
fn end_stream(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<EndStreamResponse, Error>>;
fn upload_segment_from_media_mtx(
&self,
auth_: BearerToken,
stream_path: String,
file_path: String,
duration: String,
min_timestamp_seconds: SafeLong,
min_timestamp_nanos: SafeLong,
content_length: SafeLong,
body: I,
) -> impl Future<Output = Result<(), Error>>;
}Expand description
The video service manages videos and video metadata.
Required Associated Types§
Sourcetype GetPlaylistBody: LocalAsyncWriteBody<O> + 'static
type GetPlaylistBody: LocalAsyncWriteBody<O> + 'static
The body type returned by the get_playlist method.
Sourcetype GetPlaylistInBoundsBody: LocalAsyncWriteBody<O> + 'static
type GetPlaylistInBoundsBody: LocalAsyncWriteBody<O> + 'static
The body type returned by the get_playlist_in_bounds method.
Sourcetype GetPlaylistInBoundsV2Body: LocalAsyncWriteBody<O> + 'static
type GetPlaylistInBoundsV2Body: LocalAsyncWriteBody<O> + 'static
The body type returned by the get_playlist_in_bounds_v2 method.
Sourcetype GetPlaylistV2Body: LocalAsyncWriteBody<O> + 'static
type GetPlaylistV2Body: LocalAsyncWriteBody<O> + 'static
The body type returned by the get_playlist_v2 method.
Required Methods§
Sourcefn get(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<Video, Error>>
fn get( &self, auth_: BearerToken, video_rid: VideoRid, ) -> impl Future<Output = Result<Video, Error>>
Returns video metadata associated with a video rid.
Sourcefn batch_get(
&self,
auth_: BearerToken,
request: GetVideosRequest,
) -> impl Future<Output = Result<GetVideosResponse, Error>>
fn batch_get( &self, auth_: BearerToken, request: GetVideosRequest, ) -> impl Future<Output = Result<GetVideosResponse, Error>>
Returns video metadata about each video given a set of video rids.
Sourcefn search(
&self,
auth_: BearerToken,
request: SearchVideosRequest,
) -> impl Future<Output = Result<SearchVideosResponse, Error>>
fn search( &self, auth_: BearerToken, request: SearchVideosRequest, ) -> impl Future<Output = Result<SearchVideosResponse, Error>>
Returns metadata about videos that match a given query.
Sourcefn create(
&self,
auth_: BearerToken,
request: CreateVideoRequest,
) -> impl Future<Output = Result<Video, Error>>
fn create( &self, auth_: BearerToken, request: CreateVideoRequest, ) -> impl Future<Output = Result<Video, Error>>
Creates and persists a video entity with the given metadata.
Sourcefn update_metadata(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: UpdateVideoMetadataRequest,
) -> impl Future<Output = Result<Video, Error>>
fn update_metadata( &self, auth_: BearerToken, video_rid: VideoRid, request: UpdateVideoMetadataRequest, ) -> impl Future<Output = Result<Video, Error>>
Updates the metadata for a video associated with the given video rid.
fn update_ingest_status( &self, auth_: BearerToken, video_rid: VideoRid, request: UpdateIngestStatus, ) -> impl Future<Output = Result<(), Error>>
fn get_ingest_status( &self, auth_: BearerToken, video_rid: VideoRid, ) -> impl Future<Output = Result<DetailedIngestStatus, Error>>
fn batch_get_ingest_status( &self, auth_: BearerToken, video_rids: BTreeSet<VideoRid>, ) -> impl Future<Output = Result<BTreeMap<VideoRid, DetailedIngestStatus>, Error>>
fn get_enriched_ingest_status( &self, auth_: BearerToken, request: GetEnrichedVideoIngestStatusRequest, ) -> impl Future<Output = Result<Option<EnrichedVideoIngestStatus>, Error>>
Sourcefn archive(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<(), Error>>
fn archive( &self, auth_: BearerToken, video_rid: VideoRid, ) -> impl Future<Output = Result<(), Error>>
Archives a video, which excludes it from search and hides it from being publicly visible, but does not permanently delete it. Archived videos can be unarchived.
Sourcefn unarchive(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<(), Error>>
fn unarchive( &self, auth_: BearerToken, video_rid: VideoRid, ) -> impl Future<Output = Result<(), Error>>
Unarchives a previously archived video.
Sourcefn get_playlist(
&self,
auth_: BearerToken,
video_rid: VideoRid,
start: Option<String>,
end: Option<String>,
) -> impl Future<Output = Result<Self::GetPlaylistBody, Error>>
fn get_playlist( &self, auth_: BearerToken, video_rid: VideoRid, start: Option<String>, end: Option<String>, ) -> impl Future<Output = Result<Self::GetPlaylistBody, Error>>
Generates an HLS playlist for a video within optional time bounds. Uses GET with query parameters for HLS.js compatibility. The HLS playlist will contain links to all of the segments in the video that overlap with the given bounds, or all segments if no bounds are provided.
Note: The start and end parameters must either both be provided or both be omitted. Providing only one will result in a MissingTimestampBoundPair error.
Sourcefn get_segment_summaries(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<Vec<SegmentSummary>, Error>>
fn get_segment_summaries( &self, auth_: BearerToken, video_rid: VideoRid, ) -> impl Future<Output = Result<Vec<SegmentSummary>, Error>>
Returns the min and max absolute and media timestamps for each segment in a video. To be used during frame-timestamp mapping.
Sourcefn get_playlist_in_bounds(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: GetPlaylistInBoundsRequest,
) -> impl Future<Output = Result<Self::GetPlaylistInBoundsBody, Error>>
fn get_playlist_in_bounds( &self, auth_: BearerToken, video_rid: VideoRid, request: GetPlaylistInBoundsRequest, ) -> impl Future<Output = Result<Self::GetPlaylistInBoundsBody, Error>>
Generates an HLS playlist for a video with the given video rid to enable playback within an optional set of bounds. The HLS playlist will contain links to all of the segments in the video that overlap with the given bounds. playlist will be limited to the given bounds.
Sourcefn get_playlist_in_bounds_v2(
&self,
auth_: BearerToken,
request: GetPlaylistInBoundsForChannelRequest,
) -> impl Future<Output = Result<Self::GetPlaylistInBoundsV2Body, Error>>
fn get_playlist_in_bounds_v2( &self, auth_: BearerToken, request: GetPlaylistInBoundsForChannelRequest, ) -> impl Future<Output = Result<Self::GetPlaylistInBoundsV2Body, Error>>
Generates an HLS playlist for a video series (identified by channel + tags) within bounds.
Sourcefn get_playlist_v2(
&self,
auth_: BearerToken,
data_source_rid: Option<DataSourceRid>,
asset_rid: Option<AssetRid>,
data_scope_name: Option<String>,
channel: String,
tags: Option<String>,
start: String,
end: String,
) -> impl Future<Output = Result<Self::GetPlaylistV2Body, Error>>
fn get_playlist_v2( &self, auth_: BearerToken, data_source_rid: Option<DataSourceRid>, asset_rid: Option<AssetRid>, data_scope_name: Option<String>, channel: String, tags: Option<String>, start: String, end: String, ) -> impl Future<Output = Result<Self::GetPlaylistV2Body, Error>>
Generates an HLS playlist for a video series within time bounds. Specify either dataSourceRid OR (assetRid + dataScopeName) to identify the series source.
Note: Both start and end parameters are required and must be provided together.
Sourcefn get_segment_summaries_in_bounds(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: GetSegmentSummariesInBoundsRequest,
) -> impl Future<Output = Result<Vec<SegmentSummary>, Error>>
fn get_segment_summaries_in_bounds( &self, auth_: BearerToken, video_rid: VideoRid, request: GetSegmentSummariesInBoundsRequest, ) -> impl Future<Output = Result<Vec<SegmentSummary>, Error>>
Returns the min and max absolute and media timestamps for each segment in a video that overlap with an optional set of bounds.
Sourcefn get_segment_summaries_in_bounds_v2(
&self,
auth_: BearerToken,
request: GetSegmentSummariesInBoundsForChannelRequest,
) -> impl Future<Output = Result<Vec<SegmentSummaryV2>, Error>>
fn get_segment_summaries_in_bounds_v2( &self, auth_: BearerToken, request: GetSegmentSummariesInBoundsForChannelRequest, ) -> impl Future<Output = Result<Vec<SegmentSummaryV2>, Error>>
Returns the min and max absolute and media timestamps for each segment matching a video series (identified by channel + tags) within the specified bounds.
Sourcefn get_segment_metadata_v2(
&self,
auth_: BearerToken,
request: GetSegmentMetadataForChannelRequest,
) -> impl Future<Output = Result<Option<VideoChannelSegmentsMetadata>, Error>>
fn get_segment_metadata_v2( &self, auth_: BearerToken, request: GetSegmentMetadataForChannelRequest, ) -> impl Future<Output = Result<Option<VideoChannelSegmentsMetadata>, Error>>
Returns aggregated segment metadata for a video channel series, including total frames, segment count, min/max timestamps, and average frame rate. Optionally filter by time bounds.
Sourcefn get_segment_by_timestamp_v2(
&self,
auth_: BearerToken,
request: GetSegmentByTimestampV2Request,
) -> impl Future<Output = Result<Option<SegmentV2>, Error>>
fn get_segment_by_timestamp_v2( &self, auth_: BearerToken, request: GetSegmentByTimestampV2Request, ) -> impl Future<Output = Result<Option<SegmentV2>, Error>>
Returns metadata for the segment within a video series containing the requested absolute timestamp.
Sourcefn get_segment_at_or_after_timestamp(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: GetSegmentAtOrAfterTimestampRequest,
) -> impl Future<Output = Result<Option<Segment>, Error>>
fn get_segment_at_or_after_timestamp( &self, auth_: BearerToken, video_rid: VideoRid, request: GetSegmentAtOrAfterTimestampRequest, ) -> impl Future<Output = Result<Option<Segment>, Error>>
Returns metadata for the segment containing the requested absolute timestamp. If no segment contains the timestamp, returns the closest segment starting after the timestamp. Returns empty if no segment is found at or after the timestamp.
Sourcefn get_file_summaries(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: GetFileSummariesRequest,
) -> impl Future<Output = Result<GetFileSummariesResponse, Error>>
fn get_file_summaries( &self, auth_: BearerToken, video_rid: VideoRid, request: GetFileSummariesRequest, ) -> impl Future<Output = Result<GetFileSummariesResponse, Error>>
Returns the min and max absolute timestamps from non-archived video files associated with a given video that overlap with an optional set of bounds. The files on the edges of the bounds will be truncated to segments that are inside or overlap with the bounds.
Sourcefn generate_whip_stream(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<GenerateWhipStreamResponse, Error>>
fn generate_whip_stream( &self, auth_: BearerToken, video_rid: VideoRid, ) -> impl Future<Output = Result<GenerateWhipStreamResponse, Error>>
Generates a stream ID scoped to a video and returns a WHIP URL with a MediaMTX JWT and ICE servers. Enforces write permission on the video.
Sourcefn generate_whep_stream(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<Option<GenerateWhepStreamResponse>, Error>>
fn generate_whep_stream( &self, auth_: BearerToken, video_rid: VideoRid, ) -> impl Future<Output = Result<Option<GenerateWhepStreamResponse>, Error>>
Returns WHEP URL, ICE servers, and token for playing back the active stream. Returns empty if there is no active stream. Enforces read permission on the video.
Sourcefn get_stream(
&self,
auth_: BearerToken,
video_rid: VideoRid,
stream_id: String,
) -> impl Future<Output = Result<Option<VideoStream>, Error>>
fn get_stream( &self, auth_: BearerToken, video_rid: VideoRid, stream_id: String, ) -> impl Future<Output = Result<Option<VideoStream>, Error>>
Returns stream session metadata for a given stream ID scoped to the video. Enforces read permission on the video.
Sourcefn get_streams_in_bounds(
&self,
auth_: BearerToken,
video_rid: VideoRid,
request: GetStreamsInBoundsRequest,
) -> impl Future<Output = Result<GetStreamsInBoundsResponse, Error>>
fn get_streams_in_bounds( &self, auth_: BearerToken, video_rid: VideoRid, request: GetStreamsInBoundsRequest, ) -> impl Future<Output = Result<GetStreamsInBoundsResponse, Error>>
Returns all stream sessions for a video that overlap with the specified time bounds. A stream overlaps if there is any intersection between its [start, end] interval and the provided bounds. Enforces read permission on the video.
Sourcefn end_stream(
&self,
auth_: BearerToken,
video_rid: VideoRid,
) -> impl Future<Output = Result<EndStreamResponse, Error>>
fn end_stream( &self, auth_: BearerToken, video_rid: VideoRid, ) -> impl Future<Output = Result<EndStreamResponse, Error>>
Marks the active stream session as ended for the video. Throws VIDEO_NOT_FOUND if no active stream exists. Enforces write permission on the video.
Sourcefn upload_segment_from_media_mtx(
&self,
auth_: BearerToken,
stream_path: String,
file_path: String,
duration: String,
min_timestamp_seconds: SafeLong,
min_timestamp_nanos: SafeLong,
content_length: SafeLong,
body: I,
) -> impl Future<Output = Result<(), Error>>
fn upload_segment_from_media_mtx( &self, auth_: BearerToken, stream_path: String, file_path: String, duration: String, min_timestamp_seconds: SafeLong, min_timestamp_nanos: SafeLong, content_length: SafeLong, body: I, ) -> impl Future<Output = Result<(), Error>>
MediaMTX segment upload endpoint. Receives video segments from MediaMTX hooks. Validates JWT and logs session. Future: create video segments from uploaded files.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.