aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-04-23 10:21:46 +0200
committermetamuffin <metamuffin@disroot.org>2025-04-23 10:21:46 +0200
commit9ca2e4e378b3189d2cfca27b1af9f3f53e0d6ddc (patch)
tree11e11fb72545160f005570d9374f2baba77e945e /doc
parentc843ff960dabdf40d4cf098a73d958e056d1b7d7 (diff)
downloadjellything-9ca2e4e378b3189d2cfca27b1af9f3f53e0d6ddc.tar
jellything-9ca2e4e378b3189d2cfca27b1af9f3f53e0d6ddc.tar.bz2
jellything-9ca2e4e378b3189d2cfca27b1af9f3f53e0d6ddc.tar.zst
update api doc
Diffstat (limited to 'doc')
-rw-r--r--doc/api.md58
1 files changed, 32 insertions, 26 deletions
diff --git a/doc/api.md b/doc/api.md
index b24fd46..67809cb 100644
--- a/doc/api.md
+++ b/doc/api.md
@@ -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";
```