diff options
author | metamuffin <metamuffin@disroot.org> | 2025-04-23 10:21:46 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-04-23 10:21:46 +0200 |
commit | 9ca2e4e378b3189d2cfca27b1af9f3f53e0d6ddc (patch) | |
tree | 11e11fb72545160f005570d9374f2baba77e945e | |
parent | c843ff960dabdf40d4cf098a73d958e056d1b7d7 (diff) | |
download | jellything-9ca2e4e378b3189d2cfca27b1af9f3f53e0d6ddc.tar jellything-9ca2e4e378b3189d2cfca27b1af9f3f53e0d6ddc.tar.bz2 jellything-9ca2e4e378b3189d2cfca27b1af9f3f53e0d6ddc.tar.zst |
update api doc
-rw-r--r-- | doc/api.md | 58 |
1 files changed, 32 insertions, 26 deletions
@@ -99,13 +99,11 @@ Returns headshot of a person from that node. ## Stream -### GET* `/stream/<id>?<format>&<index>&<profile>&<index>&<tracks>&<webm>` +### GET* `/n/<id>/stream?<params..>` Responds with the stream directly or a redirect to the actual source in case of federation. -# Planned stream api - - `?whep&<track...>&<seek>` - WHEP Endpoint for streaming that set of tracks. The format used is decided by the server. @@ -120,40 +118,48 @@ federation. - `?hlsvariant&<segment>&<track>&<container>&<format>` - Returns m3u8/HLS playlist of all known fragments of this track format. The playlist is updated for live media. -- `?info&<segment?>` - - Returns JSON `SegmentInfo` if a segment index is provided, else `MediaInfo` +- `?info` + - Returns JSON `StreamInfo`. - `?fragmentindex&<segment>&<track>` + - Returns time ranges for every fragment of this track. - `?fragment&<segment>&<track>&<index>&<container>&<format>` ```ts -interface MediaInfo { - title: string; - live: bool; +export type FragmentIndex = TimeRange[]; +export interface TimeRange { + start: number; + end: number; +} +export interface SubtitleCue extends TimeRange { + content: string; +} +export interface StreamInfo { + name?: string; segments: SegmentInfo[]; } -interface SegmentInfo { - title?: string; - duration?: number; - tracks: Track[]; +export interface SegmentInfo { + name?: string; + duration: number; + tracks: TrackInfo[]; } -interface Track { - title?: string; +export type TrackKind = "video" | "audio" | "subtitles"; +export interface TrackInfo { + name?: string; language?: string; - kind: "video" | "audio" | "text"; - formats: TrackFormat[]; + kind: TrackKind; + formats: FormatInfo[]; } -interface TrackFormat { +export type StreamContainer = "webm" | "matroska" | "mpeg4" | "jvtt" | "webvtt"; +export interface FormatInfo { codec: string; - bandwidth: number; - remux: bool; - title?: string; + bitrate: number; + remux: boolean; containers: StreamContainer[]; - a_sampling_frequency?: number; - a_channels?: number; - v_resolution_width?: number; - av_bit_depth?: number; + width?: number; + height?: number; + channels?: number; + samplerate?: number; + bit_depth?: number; } -type FragmentIndex = number[]; -type StreamContainer = "webm" | "matroska" | "webvtt" | "jvtt"; ``` |