From 26d3a70b0be2809177076e155f987e18e2b2ceb2 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 24 Feb 2025 18:52:42 +0100 Subject: plan new streming api --- doc/api.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'doc') diff --git a/doc/api.md b/doc/api.md index bfa49c6..5713df7 100644 --- a/doc/api.md +++ b/doc/api.md @@ -103,3 +103,54 @@ Returns headshot of a person from that node. Responds with the stream directly or a redirect to the actual source in case of federation. + +# Planned stream api + +- `?whep&&` + - WHEP Endpoint for streaming that set of tracks. The format used is decided + by the server. +- `?whepcontrol&` + - WebSocket endpoint for controlling WHEP playback. TODO schema +- `?remux&&` +- `?hlssupermultivariant&` + - Returns m3u8/HLS playlist of all known multi-variant playlists, one for each + segment. The plylist is updated for live media. +- `?hlsmultivariant&&` + - Returns m3u8/HLS playlist of all track formats' variant playlists. +- `?hlsvariant&&&&` + - Returns m3u8/HLS playlist of all known fragments of this track format. The + playlist is updated for live media. +- `?info&` + - Returns JSON `SegmentInfo` if a segment index is provided, else `MediaInfo` +- `?fragmentindex&&` +- `?fragment&&&&&` + +```ts +interface MediaInfo { + title: string; + live: bool; + segments: SegmentInfo[]; +} +interface SegmentInfo { + title?: string; + duration?: number; + tracks: Track[]; +} +interface Track { + title?: string; + language?: string; + kind: "video" | "audio" | "text"; + formats: TrackFormat[]; +} +interface TrackFormat { + codec: string; + bandwidth: number; + remux: bool; + title?: string; + + a_sampling_frequency?: number; + a_channels?: number; + v_resolution_width?: number; + av_bit_depth?: number; +} +``` -- cgit v1.2.3-70-g09d2