@iptv/xtream-api
Version:
Standardized access to Xtream compatible player API
1,053 lines (1,020 loc) • 36 kB
text/typescript
/**
* Partial implementation of Serializers type to allow defining only the needed serializers.
* This makes it easy to override just a subset of serializers while keeping defaults for others.
*/
declare type CustomSerializers = Partial<Serializers>;
/**
* Helper function to define custom serializers for the Xtream client.
*
* This function provides type checking for serializer configurations and
* returns a properly structured serializer object that can be passed to
* the Xtream constructor.
*
* @param type - A string identifier for the serializer type (e.g., 'standardized', 'jsonapi')
* @param serializers - An object containing custom serializer functions
* @returns A configured serializer object ready to use with the Xtream class
*/
export declare function defineSerializers<T extends Partial<Serializers>>(type: string, serializers: T & Record<Exclude<keyof T, keyof Serializers>, never>): {
type: string;
serializers: T;
};
/**
* Options for EPG (Electronic Program Guide) related requests.
* @property channelId - ID of the channel to get EPG data for
* @property limit - Optional number of EPG entries to return
*/
declare type EPGOptions = {
channelId: number | string;
limit?: number;
};
/**
* Options for requests that support pagination and category filtering.
* @property categoryId - Optional ID of the category to filter by
* @property page - Optional page number for pagination
* @property limit - Optional number of items per page
*/
declare type FilterableRequest = {
categoryId?: number | string;
page?: number;
limit?: number;
};
/**
* Options for movie information requests.
* @property movieId - ID of the movie to retrieve information for
*/
declare type MovieOptions = {
movieId: number | string;
};
/**
* Configuration options for initializing the Xtream API client.
* @property url - Base URL of the Xtream API server
* @property username - Username for authentication
* @property password - Password for authentication
* @property preferredFormat - Optional preferred streaming format (default: 'ts')
*/
declare type Options = {
url: string;
username: string;
password: string;
preferredFormat?: string;
};
export declare type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
/**
* Serializers type definition that specifies transformation functions for each type of API response.
* These functions allow for custom mapping and transformation of the raw API data into
* alternative formats or structures as needed.
*/
declare type Serializers = {
profile: (input: XtreamUserProfile) => any;
serverInfo: (input: XtreamServerInfo) => any;
channelCategories: (input: XtreamCategory[]) => any;
movieCategories: (input: XtreamCategory[]) => any;
showCategories: (input: XtreamCategory[]) => any;
channels: (input: XtreamChannel[]) => any;
movies: (input: XtreamMoviesListing[]) => any;
movie: (input: XtreamMovie) => any;
shows: (input: XtreamShowListing[]) => any;
show: (input: XtreamShow) => any;
shortEPG: (input: XtreamShortEPG) => any;
fullEPG: (input: XtreamFullEPG) => any;
};
/**
* Options for show information requests.
* @property showId - ID of the show to retrieve information for
*/
declare type ShowOptions = {
showId: number | string;
};
/**
* Parameters for generating a streaming URL.
* @property type - Type of content to stream ('movie', 'episode', or 'channel')
* @property streamId - ID of the stream
* @property extension - File extension/format for the stream
* @property timeshift - Optional timeshift settings for live TV playback from a specific point in time
*/
declare type StreamURLRequest = {
type: 'movie' | 'episode' | 'channel';
streamId: number | string;
extension: string;
timeshift?: {
start: Date;
duration: number;
};
};
/**
* Xtream API client for interacting with Xtream compatible IPTV services.
*
* This class provides methods to query and retrieve various types of content
* from an Xtream compatible API, including live channels, movies, TV shows,
* and EPG data. It also supports custom serialization of API responses.
*
* @template T - Type of custom serializers being used
*/
export declare class Xtream<T extends CustomSerializers = CustomSerializers> {
#private;
baseUrl: string;
/**
* Indicates the type of serializer being used (e.g., 'none', 'standardized', 'jsonapi')
* Used for diagnostic and informational purposes.
*/
serializerType: string;
/**
* Cached user profile information to avoid repeated API calls.
* This is populated on first use when needed and contains information
* about user permissions, allowed formats, etc.
*/
userProfile?: XtreamUserProfile;
/**
* Creates a new instance of the Xtream service.
*
* @param options - Configuration options for the Xtream client
* @param options.url - The base URL of the Xtream API
* @param options.username - The username to authenticate with
* @param options.password - The password to authenticate with
* @param options.preferredFormat - Optional preferred streaming format
* @param options.serializer - Optional custom serializers for transforming API responses
* @throws Error if required parameters are missing
*/
constructor({ url, username, password, preferredFormat, serializer, }: Options & {
serializer?: ReturnType<typeof defineSerializers<T>>;
});
/**
* Generates a stream URL for various content types (live channels, movies, TV show episodes).
*
* This method constructs the appropriate URL based on content type, format, and optional
* timeshift parameters. It ensures the requested format is allowed for the user.
*
* @param stream - The stream request parameters
* @returns The complete streaming URL or undefined if an invalid type is provided
*/
generateStreamUrl(stream: StreamURLRequest): string | undefined;
/**
* Gets the profile information of the authenticated user.
*
* This includes subscription details, allowed output formats, and other user-specific settings.
*
* @returns The user profile information, optionally transformed by custom serializer
*/
getProfile(): Promise<T extends {
profile: (input: XtreamUserProfile) => infer R;
} ? R : XtreamUserProfile>;
/**
* Gets information about the Xtream server.
*
* This includes details about the server's time, timezone, and version.
*
* @returns Server information, optionally transformed by custom serializer
*/
getServerInfo(): Promise<T extends {
serverInfo: (input: XtreamServerInfo) => infer R;
} ? R : XtreamServerInfo>;
/**
* Gets the list of all available live channel categories.
*
* Categories are used to organize content into groups like Sports, News, Entertainment, etc.
*
* @returns A list of channel categories, optionally transformed by custom serializer
*/
getChannelCategories(): Promise<T extends {
channelCategories: (input: XtreamCategory[]) => infer R;
} ? R : XtreamCategory[]>;
/**
* Gets the list of all available movie categories.
*
* Categories are used to organize content into groups like Action, Comedy, Drama, etc.
*
* @returns A list of movie categories, optionally transformed by custom serializer
*/
getMovieCategories(): Promise<T extends {
movieCategories: (input: XtreamCategory[]) => infer R;
} ? R : XtreamCategory[]>;
/**
* Gets the list of all available TV show categories.
*
* Categories are used to organize content into groups like Drama, Comedy, Documentary, etc.
*
* @returns A list of TV show categories, optionally transformed by custom serializer
*/
getShowCategories(): Promise<T extends {
showCategories: (input: XtreamCategory[]) => infer R;
} ? R : XtreamCategory[]>;
/**
* Gets the list of available live channels, with optional filtering and pagination.
*
* This method also automatically generates streaming URLs for each channel
* and adds them to the channel objects.
*
* @param options - Filter and pagination options
* @param options.categoryId - Optional category ID to filter channels by
* @param options.page - Optional page number for paginated results
* @param options.limit - Optional number of items per page
* @returns A list of channels, optionally transformed by custom serializer
*/
getChannels({ categoryId, page, limit }?: FilterableRequest): Promise<T extends {
channels: (input: XtreamChannel[]) => infer R;
} ? R : XtreamChannel[]>;
/**
* Gets the list of available movies, with optional filtering and pagination.
*
* This method also automatically generates streaming URLs for each movie
* and adds them to the movie objects.
*
* @param options - Filter and pagination options
* @param options.categoryId - Optional category ID to filter movies by
* @param options.page - Optional page number for paginated results
* @param options.limit - Optional number of items per page
* @returns A list of movies, optionally transformed by custom serializer
*/
getMovies({ categoryId, page, limit }?: FilterableRequest): Promise<T extends {
movies: (input: XtreamMoviesListing[]) => infer R;
} ? R : XtreamMoviesListing[]>;
/**
* Gets detailed information about a specific movie.
*
* This includes metadata like plot, cast, director, release date, etc.
* Also generates and adds the streaming URL to the movie object.
*
* @param options - The movie request options
* @param options.movieId - ID of the movie to retrieve
* @returns Detailed movie information, optionally transformed by custom serializer
* @throws Error if the movie is not found
*/
getMovie({ movieId, }: MovieOptions): Promise<T extends {
movie: (input: XtreamMovie) => infer R;
} ? R : XtreamMovie>;
/**
* Gets the list of available TV shows, with optional filtering and pagination.
*
* @param options - Filter and pagination options
* @param options.categoryId - Optional category ID to filter shows by
* @param options.page - Optional page number for paginated results
* @param options.limit - Optional number of items per page
* @returns A list of TV shows, optionally transformed by custom serializer
*/
getShows({ categoryId, page, limit }?: FilterableRequest): Promise<T extends {
shows: (input: XtreamShowListing[]) => infer R;
} ? R : XtreamShowListing[]>;
/**
* Gets detailed information about a specific TV show.
*
* This includes metadata about the show and all its episodes organized by season.
* Also generates and adds streaming URLs for each episode.
*
* @param options - The show request options
* @param options.showId - ID of the show to retrieve
* @returns Detailed show information, optionally transformed by custom serializer
* @throws Error if the show is not found
*/
getShow({ showId }: ShowOptions): Promise<T extends {
show: (input: XtreamShow) => infer R;
} ? R : XtreamShow>;
/**
* Gets short EPG (Electronic Program Guide) information for a specific channel.
*
* Short EPG typically contains programming information for a limited time period.
*
* @param options - The EPG request options
* @param options.channelId - ID of the channel to retrieve EPG for
* @param options.limit - Optional number of EPG entries to return
* @returns Short EPG information, optionally transformed by custom serializer
*/
getShortEPG({ channelId, limit, }: EPGOptions): Promise<T extends {
shortEPG: (input: XtreamShortEPG) => infer R;
} ? R : XtreamShortEPG>;
/**
* Gets full EPG (Electronic Program Guide) information for a specific channel.
*
* Full EPG contains complete programming information for a longer time period.
*
* @param options - The EPG request options
* @param options.channelId - ID of the channel to retrieve EPG for
* @returns Full EPG information, optionally transformed by custom serializer
*/
getFullEPG({ channelId, }: EPGOptions): Promise<T extends {
fullEPG: (input: XtreamFullEPG) => infer R;
} ? R : XtreamFullEPG>;
}
/**
* Xtream audio information
*
* This type represents the technical details of an audio stream
*/
export declare type XtreamAudioInfo = {
/** The stream index in the container */
index: number;
/** The short name of the codec */
codec_name: string;
/** The full name of the codec */
codec_long_name: string;
/** The type of the codec (e.g., "audio") */
codec_type: string;
/** The codec tag as a string */
codec_tag_string: string;
/** The codec tag */
codec_tag: string;
/** The sample format */
sample_fmt: string;
/** The sample rate in Hz */
sample_rate: string;
/** The number of audio channels */
channels: number;
/** The channel layout (e.g., "stereo") */
channel_layout: string;
/** The bits per sample */
bits_per_sample: number;
/** The real frame rate */
r_frame_rate: string;
/** The average frame rate */
avg_frame_rate: string;
/** The time base */
time_base: string;
/** The starting presentation timestamp */
start_pts: number;
/** The starting time */
start_time: string;
/** The bitrate in bits per second */
bit_rate: string;
/** The stream disposition flags */
disposition: {
/** Default flag */
default: number;
/** Dub flag */
dub: number;
/** Original flag */
original: number;
/** Comment flag */
comment: number;
/** Lyrics flag */
lyrics: number;
/** Karaoke flag */
karaoke: number;
/** Forced flag */
forced: number;
/** Hearing impaired flag */
hearing_impaired: number;
/** Visual impaired flag */
visual_impaired: number;
/** Clean effects flag */
clean_effects: number;
/** Attached picture flag */
attached_pic: number;
/** Timed thumbnails flag */
timed_thumbnails: number;
/** Captions flag */
captions: number;
/** Descriptions flag */
descriptions: number;
/** Metadata flag */
metadata: number;
/** Dependent flag */
dependent: number;
/** Still image flag */
still_image: number;
};
/** The metadata tags */
tags: {
[key: string]: string;
};
};
/**
* Xtream category information
*
* This type represents a content category in the Xtream system
*/
export declare type XtreamCategory = {
/** The unique identifier for the category */
category_id: string;
/** The display name of the category */
category_name: string;
/** The ID of the parent category, if applicable */
parent_id: number;
};
/**
* Xtream channel information
*
* This type represents a live TV channel in the Xtream system
*/
export declare type XtreamChannel = {
/** The position/order number of the channel */
num: number;
/** The name of the channel */
name: string;
/** The type of stream (e.g., "live") */
stream_type: string;
/** The unique identifier for the stream */
stream_id: number;
/** The URL for the channel's logo */
stream_icon: string;
/** The URL for the channel's cover image */
thumbnail: string;
/** The Electronic Program Guide channel ID */
epg_channel_id: string;
/** The date when the channel was added to the system */
added: string;
/** The primary category ID of the channel */
category_id: string;
/** All category IDs the channel belongs to */
category_ids: number[];
/** Custom stream identifier */
custom_sid: string;
/** Flag indicating if TV archive is available (0/1) */
tv_archive: number;
/** The direct URL to the channel's source */
direct_source: string;
/** The duration of available archive in days */
tv_archive_duration: number;
/** The URL to access the channel */
url?: string;
};
/**
* Xtream EPG listing information
*
* This type represents a single EPG listing for a channel
*/
export declare type XtreamEPGListing = {
/** The unique identifier for the listing */
id: string;
/** The EPG ID of the listing */
epg_id: string;
/** The title of the listing */
title: string;
/** The language of the listing */
lang: string;
/** The start time of the listing */
start: string;
/** The end time of the listing */
end: string;
/** The description of the listing */
description: string;
/** The channel ID of the listing */
channel_id: string;
/** The start timestamp of the listing */
start_timestamp: string;
/** The stop timestamp of the listing */
stop_timestamp: string;
/** The stop time of the listing */
stop: string;
};
/**
* Xtream episode information
*
* This type represents an episode in a show in the Xtream system
*/
export declare type XtreamEpisode = {
/** The unique identifier for the episode */
id: string;
/** The episode number within the season */
episode_num: string;
/** The title of the episode */
title: string;
/** The file format extension */
container_extension: string;
/** Detailed information about the episode */
info: XtreamEpisodeInfo;
/** Custom stream identifier */
custom_sid: string;
/** The date when the episode was added to the system */
added: string;
/** The season number the episode belongs to */
season: number;
/** The direct URL to the episode's source */
direct_source: string;
/** URLs to subtitle files */
subtitles: string[];
/** The URL to access the episode */
url?: string;
};
/**
* Xtream episode information
*
* This type represents the information about an episode in a show
*/
export declare type XtreamEpisodeInfo = {
/** The air date of the episode */
air_date?: string;
/** The release date of the episode */
release_date: string | null;
/** The plot of the episdoe */
plot: string | null;
/** The rating of the episode */
rating: number;
/** The image of the episode */
movie_image: string;
/** The big cover of the episode */
cover_big: string;
/** The duration of the episode in seconds */
duration_secs: number;
/** The formatted duration of the episode */
duration: string;
/** The id of the episode in The Movie Database */
tmdb_id: number;
/** The video information of the episode */
video?: XtreamVideoInfo;
/** The audio information of the episode */
audio?: XtreamAudioInfo;
/** The bitrate of the episode */
bitrate: number;
/** The season number of the episode */
season: number;
};
/**
* Xtream EPG information
*
* This type represents all EPG information for a channel stored in the Xtream system
*/
export declare type XtreamFullEPG = {
/** The list of EPG listings */
epg_listings: XtreamFullEPGListing[];
};
/**
* Xtream full EPG listing information
*
* This type represents a single EPG listing for a channel with additional information
*/
export declare type XtreamFullEPGListing = Prettify<Omit<XtreamEPGListing, 'stop'> & {
/** Flag indicating if the listing is currently playing */
now_playing: number;
/** Flag indicating if the listing has an archive available */
has_archive: number;
}>;
/**
* Xtream movie information
*
* This type represents the detailed information about a movie
*/
export declare type XtreamMovie = {
/** The information about the movie */
info: XtreamMovieInfo;
/** Extra details of the movie */
movie_data: XtreamMovieData;
url?: string;
};
/**
* Xtream movie data
*
* This type represents the extra details of a movie stream
*/
export declare type XtreamMovieData = {
/** The unique identifier for the stream */
stream_id: number;
/** The title of the movie */
name: string;
/** The title of the movie */
title: string;
/** The year the movie was released */
year: string | null;
/** The date when the movie was added to the system */
added: string;
/** The primary category ID of the movie */
category_id: string;
/** All category IDs the movie belongs to */
category_ids: number[];
/** The file format extension */
container_extension: string;
/** Custom stream identifier */
custom_sid: string;
/** The direct URL to the movie's source */
direct_source: string;
};
/**
* Xtream movie information
*
* This type represents the technical details of a movie stream
*/
export declare type XtreamMovieInfo = {
/** The URL to the movie's Kinopoisk page */
kinopoisk_url: string;
/** The ID of the movie in The Movie Database (TMDB) */
tmdb_id: number;
/** The title of the movie */
name: string;
/** The original title of the movie */
o_name: string;
/** The URL for the movie's cover image */
cover_big: string;
/** The URL for the movie's image */
movie_image: string;
/** The release date of the movie */
release_date: string | null;
/** The runtime of the movie in minutes */
episode_run_time: number | null;
/** The YouTube ID or URL for the trailer */
youtube_trailer: string | null;
/** The director(s) of the movie */
director: string | null;
/** The actors in the movie */
actors: string | null;
/** The cast of the movie */
cast: string | null;
/** The synopsis/description of the movie */
description: string | null;
/** The plot of the movie */
plot: string | null;
/** The age rating of the movie */
age: string;
/** The MPAA rating of the movie */
mpaa_rating: string;
/** The number of ratings on Kinopoisk */
rating_count_kinopoisk: number;
/** The country of origin for the movie */
country: string;
/** The genre(s) of the movie */
genre: string | null;
/** Array of backdrop image URLs */
backdrop_path: string[];
/** The duration of the movie in seconds */
duration_secs: number;
/** The formatted duration of the movie */
duration: string;
/** The bitrate of the movie */
bitrate: number;
/** The release date of the movie */
releasedate: string | null;
/** Array of available subtitles */
subtitles: string[];
/** The rating of the movie */
rating: number;
};
/**
* Xtream movie information
*
* This type represents a movie in the Xtream system
*/
export declare type XtreamMoviesListing = {
/** The position/order number of the movie */
num: number;
/** The title of the movie */
name: string;
/** Year released */
year: string | null;
/** The title of the movie */
title: string;
/** The type of stream (e.g., "movie") */
stream_type: string;
/** The unique identifier for the stream */
stream_id: number;
/** The URL for the movie's icon/poster */
stream_icon: string;
/** The movie's rating as a string */
rating: number;
/** The movie's rating on a 5-point scale */
rating_5based: number;
/** The genres of the movie */
genre: string | null;
/** The date when the movie was added to the system */
added: string;
/** The runtime of the movie in minutes */
episode_run_time: number | null;
/** The primary category ID of the movie */
category_id: string;
/** All category IDs the movie belongs to */
category_ids: number[];
/** The file format extension */
container_extension: string;
/** Custom stream identifier */
custom_sid: any;
/** The direct URL to the movie's source */
direct_source: string;
/** The release date of the movie */
release_date: string | null;
/** The cast of the movie */
cast: string | null;
/** The director(s) of the movie */
director: string | null;
/** The synopsis/description of the movie */
plot: string | null;
/** Youtube ID of the trailer */
youtube_trailer: string | null;
/** The URL to access the movie */
url?: string;
};
/**
* These types represent the data as retrieved from the Xtream API
* Not every version of the Xtream API will return all of these fields
*/
/**
* Xtream profile information
*
* This type represents the complete profile information including user details and server information
*/
export declare type XtreamProfile = {
/** Information about the user's account */
user_info: XtreamUserProfile;
/** Information about the Xtream server */
server_info: XtreamServerInfo;
};
/**
* Xtream season information
*
* This type represents a season of a show in the Xtream system
*/
export declare type XtreamSeason = {
/** The unique identifier for the season */
id: number;
/** The name of the season */
name: string;
/** The number of episodes in the season as a string */
episode_count: number;
/** The synopsis/description of the season */
overview: string;
/** The date when the season first aired */
air_date: string | null;
/** The URL for the season's cover image */
cover: string;
/** The season number */
season_number: number;
/** The URL for a larger version of the season's cover */
cover_big: string;
/** The average rating vote for the season */
vote_average: number;
};
/**
* Xtream server information
*
* This type represents the server-specific part of the profile
*/
export declare type XtreamServerInfo = {
/** Flag to indicate if it is a XUI instance */
xui: boolean;
/** Software version */
version: string;
/** Software revision */
revision: string | null;
/** The base URL of the Xtream server */
url: string;
/** The HTTP port number */
port: string;
/** The HTTPS port number */
https_port: string;
/** The protocol used by the server */
server_protocol: string;
/** The RTMP port number for streaming */
rtmp_port: string;
/** The timezone setting of the server */
timezone: string;
/** The current server timestamp */
timestamp_now: number;
/** The current server time as a formatted string */
time_now: string;
};
/**
* Xtream short EPG information
*
* This type represents the short EPG information for a channel
*/
export declare type XtreamShortEPG = {
/** The list of EPG listings */
epg_listings: XtreamEPGListing[];
};
/**
* Xtream show detailed information
*
* This type represents the complete information about a show including seasons and episodes
*/
export declare type XtreamShow = {
/** Array of seasons in the show */
seasons: XtreamSeason[];
/** Basic information about the show */
info: XtreamShowInfo;
/** Object containing episodes grouped by season number */
episodes: {
[key: string]: XtreamEpisode[];
};
};
export declare type XtreamShowInfo = {
/** The title of the show */
name: string;
/** The title of the show */
title: string;
/** The year of release */
year: string | null;
/** The unique identifier for the series, added by this library */
series_id?: number;
/** The URL for the show's cover image */
cover: string;
/** The synopsis/description of the show */
plot: string | null;
/** The cast members of the show */
cast: string | null;
/** The director(s) of the show */
director: string | null;
/** The genre(s) of the show */
genre: string | null;
/** The release date of the show (alternate format) */
releaseDate: string | null;
/** The release date of the show */
release_date: string | null;
/** The date when the show was last updated */
last_modified: string;
/** The show's rating as a string */
rating: string;
/** The show's rating on a 5-point scale as a string */
rating_5based: number;
/** Array of backdrop image URLs */
backdrop_path: string[];
/** The YouTube ID or URL for the trailer */
youtube_trailer: string | null;
/** The average runtime of episodes as a string */
episode_run_time: string | null;
/** The primary category ID of the show */
category_id: string;
/** All category IDs the show belongs to */
category_ids: number[];
};
/**
* Xtream show information
*
* This type represents a show listing in the Xtream system
*/
export declare type XtreamShowListing = {
/** The position/order number of the show */
num: number;
/** The title of the show */
name: string;
/** The title of the show */
title: string;
/** The year of release */
year: string | null;
/** The unique identifier for the series */
series_id: number;
/** The type of stream (e.g., "series") */
stream_type: string;
/** The URL for the show's cover image */
cover: string;
/** The synopsis/description of the show */
plot: string | null;
/** The cast members of the show */
cast: string | null;
/** The director(s) of the show */
director: string | null;
/** The genre(s) of the show */
genre: string | null;
/** The release date of the show (alternate format) */
releaseDate: string | null;
/** The release date of the show */
release_date: string | null;
/** The date when the show was last updated */
last_modified: string;
/** The show's rating as a string */
rating: string;
/** The show's rating on a 5-point scale as a string */
rating_5based: number;
/** Array of backdrop image URLs */
backdrop_path: string[];
/** The YouTube ID or URL for the trailer */
youtube_trailer: string | null;
/** The average runtime of episodes as a string */
episode_run_time: string | null;
/** The primary category ID of the show */
category_id: string;
/** All category IDs the show belongs to */
category_ids: number[];
};
/**
* Xtream user profile information
*
* This type represents the user-specific part of the profile
*/
export declare type XtreamUserProfile = {
/** The username of the account */
username: string;
/** The password of the account */
password: string;
/** Any message from the server about the account */
message: string;
/** Authentication status (1 for authenticated) */
auth: number;
/** Account status (e.g., "Active") */
status: string;
/** The expiration date of the account */
exp_date: string;
/** Flag indicating if the account is a trial */
is_trial: string;
/** Number of active connections currently used */
active_cons: number;
/** The date when the account was created */
created_at: string;
/** Maximum allowed concurrent connections */
max_connections: string;
/** Formats the user is allowed to access */
allowed_output_formats: string[];
};
/**
* Xtream video information
*
* This type represents the technical details of a video stream
*/
export declare type XtreamVideoInfo = {
/** The stream index in the container */
index: number;
/** The short name of the codec */
codec_name: string;
/** The full name of the codec */
codec_long_name: string;
/** The codec profile */
profile: string;
/** The type of the codec (e.g., "video") */
codec_type: string;
/** The codec tag as a string */
codec_tag_string: string;
/** The codec tag */
codec_tag: string;
/** The width of the video in pixels */
width: number;
/** The height of the video in pixels */
height: number;
/** The coded width of the video */
coded_width: number;
/** The coded height of the video */
coded_height: number;
/** Flag indicating if closed captions are available */
closed_captions: number;
/** Flag indicating if film grain is present */
film_grain: number;
/** Flag indicating if B-frames are used */
has_b_frames: number;
/** The sample aspect ratio */
sample_aspect_ratio: string;
/** The display aspect ratio */
display_aspect_ratio: string;
/** The pixel format */
pix_fmt: string;
/** The codec level */
level: number;
/** The color range */
color_range: string;
/** The color space */
color_space: string;
/** The color transfer characteristics */
color_transfer: string;
/** The color primaries */
color_primaries: string;
/** The chroma sample location */
chroma_location: string;
/** The field order */
field_order: string;
/** The number of reference frames */
refs: number;
/** Flag indicating if AVC format is used */
is_avc: string;
/** The NAL unit length size */
nal_length_size: string;
/** The real frame rate */
r_frame_rate: string;
/** The average frame rate */
avg_frame_rate: string;
/** The time base */
time_base: string;
/** The starting presentation timestamp */
start_pts: number;
/** The starting time */
start_time: string;
/** The bits per raw sample */
bits_per_raw_sample: string;
/** The size of extra data */
extradata_size: number;
/** The stream disposition flags */
disposition: {
/** Default flag */
default: number;
/** Dub flag */
dub: number;
/** Original flag */
original: number;
/** Comment flag */
comment: number;
/** Lyrics flag */
lyrics: number;
/** Karaoke flag */
karaoke: number;
/** Forced flag */
forced: number;
/** Hearing impaired flag */
hearing_impaired: number;
/** Visual impaired flag */
visual_impaired: number;
/** Clean effects flag */
clean_effects: number;
/** Attached picture flag */
attached_pic: number;
/** Timed thumbnails flag */
timed_thumbnails: number;
/** Captions flag */
captions: number;
/** Descriptions flag */
descriptions: number;
/** Metadata flag */
metadata: number;
/** Dependent flag */
dependent: number;
/** Still image flag */
still_image: number;
};
/** The metadata tags */
tags: {
[key: string]: string;
};
};
export { }