/// <reference types="node" />
import { EventEmitter } from 'stream';
import { MStreamingPlaylistVideo, MUserId, MVideoLiveVideo } from '../../../types/models';
interface MuxingSessionEvents {
    'live-ready': (options: {
        videoId: number;
    }) => void;
    'bad-socket-health': (options: {
        videoId: number;
    }) => void;
    'duration-exceeded': (options: {
        videoId: number;
    }) => void;
    'quota-exceeded': (options: {
        videoId: number;
    }) => void;
    'ffmpeg-end': (options: {
        videoId: number;
    }) => void;
    'ffmpeg-error': (options: {
        videoId: number;
    }) => void;
    'after-cleanup': (options: {
        videoId: number;
    }) => void;
}
declare interface MuxingSession {
    on<U extends keyof MuxingSessionEvents>(event: U, listener: MuxingSessionEvents[U]): this;
    emit<U extends keyof MuxingSessionEvents>(event: U, ...args: Parameters<MuxingSessionEvents[U]>): boolean;
}
declare class MuxingSession extends EventEmitter {
    private ffmpegCommand;
    private readonly context;
    private readonly user;
    private readonly sessionId;
    private readonly videoLive;
    private readonly streamingPlaylist;
    private readonly inputUrl;
    private readonly fps;
    private readonly allResolutions;
    private readonly bitrate;
    private readonly ratio;
    private readonly hasAudio;
    private readonly videoId;
    private readonly videoUUID;
    private readonly saveReplay;
    private readonly outDirectory;
    private readonly replayDirectory;
    private readonly liveSegmentShaStore;
    private readonly lTags;
    private segmentsToProcessPerPlaylist;
    private tsWatcher;
    private masterWatcher;
    private m3u8Watcher;
    private masterPlaylistCreated;
    private liveReady;
    private aborted;
    private readonly isAbleToUploadVideoWithCache;
    private readonly hasClientSocketInBadHealthWithCache;
    constructor(options: {
        context: any;
        user: MUserId;
        sessionId: string;
        videoLive: MVideoLiveVideo;
        streamingPlaylist: MStreamingPlaylistVideo;
        inputUrl: string;
        fps: number;
        bitrate: number;
        ratio: number;
        allResolutions: number[];
        hasAudio: boolean;
    });
    runMuxing(): Promise<void>;
    abort(): void;
    destroy(): void;
    private onFFmpegError;
    private onFFmpegEnded;
    private watchMasterFile;
    private watchM3U8File;
    private watchTSFiles;
    private isQuotaExceeded;
    private createFiles;
    private prepareDirectories;
    private isDurationConstraintValid;
    private processSegments;
    private processSegment;
    private hasClientSocketInBadHealth;
    private addSegmentToReplay;
}
export { MuxingSession };
//# sourceMappingURL=muxing-session.d.ts.map