Skip to content

Streaming API

Stream media files from your library via HLS.

Start stream

http
GET /api/stream/:fileId
Authorization: Bearer <token>

Query parameters:

ParameterTypeDescription
qualitystringTranscoding quality: original, 1080p, 720p, 480p
audioTracknumberAudio track index
subtitleTracknumberSubtitle track index

Response: Redirects to the HLS manifest URL.

HLS manifest

http
GET /api/stream/:fileId/manifest.m3u8
Authorization: Bearer <token>

Returns an HLS manifest (M3U8) with segment URLs. The player uses this to stream the file.

Response:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:6.000000,
segment-0.ts
#EXTINF:6.000000,
segment-1.ts
...

Report progress

http
POST /api/stream/:fileId/progress
Authorization: Bearer <token>
Content-Type: application/json

{
  "positionSeconds": 1234,
  "durationSeconds": 8880,
  "completed": false
}

Reports the current playback position. Used for "Continue watching" and watch history.

Response:

json
{
  "saved": true
}

Transcoding profiles

When quality is set to anything other than original, OmniLux transcodes on the fly using FFmpeg:

QualityResolutionVideo codecBitrate
originalSourceSourceSource
1080p1920x1080H.264 / NVENC8 Mbps
720p1280x720H.264 / NVENC4 Mbps
480p854x480H.264 / NVENC2 Mbps

NVENC (hardware) is used when available, falling back to libx264 (software).

Subtitle and audio track selection

Use the file detail endpoint to discover available tracks:

http
GET /api/library/files/:id

The response includes tracks with type (video, audio, subtitle), language, and index. Pass the desired audioTrack or subtitleTrack index when starting a stream.

External subtitle files (SRT, ASS, VTT) discovered alongside the media file are also available.

Use OmniLux, run your own server, or build on the platform.