export interface SubtitleTrack { //ordinal among subtitle streams, matching ffmpeg's 0:s: mapping streamIndex: number; language?: string; title?: string; default: boolean; forced: boolean; codec?: string; } export interface AudioTrack { //ordinal among audio streams, matching ffmpeg's 0:a: mapping streamIndex: number; language?: string; title?: string; default: boolean; } export interface Chapter { start: number; end?: number; title: string; } export interface VideoExtras { subtitleTracks: SubtitleTrack[]; chapters: Chapter[]; } export interface Metadata { duration: number; trackNumber?: number; title?: string; artist?: string; album?: string; genre?: string[]; audioCodec?: string; audioBitrate?: number; videoCodec?: string; videoBitrate?: number; videoWidth?: number; videoHeight?: number; frameRate?: number; interlaced?: boolean; container?: string; audioTracks?: AudioTrack[]; subtitleTracks?: SubtitleTrack[]; } export interface IsVideoResponse { isVideo: boolean; } export interface MediaFile { metadata: Metadata; } export interface Directory { files: FileListing; } //Scanned = we know which children exist //Unknown = either: // - not scanned (is a subdirectory and recursive=false) // - only partially exists, because some deeper file was scanned, and this entry only exists as a link export interface DirectoryWithStatus { files: FileListingWithStatus; status: "Scanned" | "Unknown"; } export type FileListing = Record; export type FileListingWithStatus = Record; export enum MediaContainer { mp4 = "mp4", webm = "webm", mp3 = "mp3", ogg = "ogg", } export enum VideoCodec { none = "none", av1 = "av1", h264 = "h264", h265 = "h265", vp9 = "vp9", } export enum AudioCodec { opus = "opus", aac = "aac", vorbis = "vorbis", mp3 = "mp3", flac = "flac", } export enum VideoEncodingSetting { veryfast = "veryfast", fast = "fast", balanced = "balanced", quality = "quality", }