UNPKG

@eleven-am/transcoder

Version:

High-performance HLS transcoding library with hardware acceleration, intelligent client management, and distributed processing support for Node.js

99 lines 4.35 kB
import { ISegmentProcessor } from './distributed'; import { ClientSession, HLSManagerOptions, SegmentStream, StreamConfig, StreamMetricsEventHandler, StreamType, SubtitleInfo } from './types'; export declare class HLSController { #private; readonly streamConfig: Partial<StreamConfig>; constructor(options: HLSManagerOptions); /** * Initialize the HLS manager * This will initialize the transcodeService and detect hardware acceleration */ initialize(): Promise<void>; /** * Get the master playlist for a media source * @param filePath The file path of the media source * @param clientId The client ID of the user requesting the stream */ getMasterPlaylist(filePath: string, clientId: string): Promise<string>; /** * Get the playlist for a media source with the given stream type and quality * @param filePath The file path of the media source * @param clientId The client ID of the user requesting the stream * @param type The stream type * @param quality The stream quality * @param streamIndex The stream index */ getIndexPlaylist(filePath: string, clientId: string, type: StreamType, quality: string, streamIndex: number): Promise<string>; /** * Get the segment stream for a media source with the given stream type and quality * @param filePath The file path of the media source * @param clientId The client ID of the user requesting the stream * @param type The stream type * @param quality The stream quality * @param streamIndex The stream index * @param segmentNumber The segment number to get */ getSegmentStream(filePath: string, clientId: string, type: StreamType, quality: string, streamIndex: number, segmentNumber: number): Promise<SegmentStream>; /** * Extract subtitle from a media source and convert to WebVTT * @param filePath The file path of the media source * @param streamIndex The subtitle stream index to extract * @returns TaskEither containing the VTT content as string */ getVTTSubtitle(filePath: string, streamIndex: number): Promise<string>; /** * Extract subtitle from a media source and convert to WebVTT * @param filePath The file path of the media source * @param streamIndex The subtitle stream index to extract * @returns TaskEither containing the VTT content as stream */ getVTTSubtitleStream(filePath: string, streamIndex: number): Promise<NodeJS.ReadableStream>; /** * Create a screenshot from a media source at a specific timestamp * @param filePath The file path of the media source * @param quality The quality of the screenshot * @param streamIndex The stream index to take the screenshot from * @param time The time to take the screenshot at */ generateScreenshot(filePath: string, quality: string, streamIndex: number, time: number): Promise<NodeJS.ReadableStream>; /** * Get all convertible subtitle streams from media metadata * @param filePath The file path of the media source */ getConvertibleSubtitles(filePath: string): Promise<SubtitleInfo[]>; /** * Sets up a listener for when the client session changes * @param callback The callback to call when the session changes */ onSessionChange(callback: (session: ClientSession) => void): void; /** * Sets up a listener for when the stream metrics change * @param callback The callback to call when the metrics change */ onStreamMetrics(callback: StreamMetricsEventHandler): void; /** * Get the current job processor status * @returns The current status of the job processor */ getJobProcessorStatus(): { queueLength: number; activeJobs: number; maxConcurrentJobs: number; isProcessing: boolean; }; /** * Get the segment processor * @returns The segment processor instance or null */ getSegmentProcessor(): ISegmentProcessor | null; /** * Create metadata for a media source * @param filePath The file path of the media source */ createMetadata(filePath: string): Promise<void>; /** * Dispose of the controller and clean up resources */ dispose(): Promise<void>; } //# sourceMappingURL=hlsController.d.ts.map