@eleven-am/transcoder
Version:
High-performance HLS transcoding library with hardware acceleration, intelligent client management, and distributed processing support for Node.js
77 lines • 1.78 kB
TypeScript
/**
* Data required for processing a single segment
*/
export interface SegmentProcessingData {
fileId: string;
sourceFilePath: string;
streamType: string;
quality: string;
streamIndex: number;
segmentIndex: number;
segmentStart: number;
segmentDuration: number;
totalSegments: number;
ffmpegOptions: {
inputOptions: string[];
outputOptions: string[];
videoFilters?: string;
};
outputPath: string;
}
/**
* Result of segment processing
*/
export interface SegmentProcessingResult {
success: boolean;
segmentIndex: number;
outputPath: string;
processingTime?: number;
cached?: boolean;
error?: Error;
}
/**
* Interface for segment processors
*/
export interface ISegmentProcessor {
/**
* Process a single segment
*/
processSegment(data: SegmentProcessingData): Promise<SegmentProcessingResult>;
/**
* Check if processor is healthy and ready
*/
isHealthy(): Promise<boolean>;
/**
* Get current processing mode
*/
getMode(): 'local' | 'distributed';
/**
* Cleanup resources
*/
dispose(): Promise<void>;
}
/**
* Segment claim for distributed processing
*/
export interface SegmentClaim {
acquired: boolean;
segmentKey: string;
workerId: string;
expiresAt: number;
extend: () => Promise<boolean>;
release: () => Promise<void>;
}
/**
* Configuration for distributed processing
*/
export interface DistributedConfig {
redisUrl?: string;
workerId?: string;
claimTTL?: number;
claimRenewalInterval?: number;
segmentTimeout?: number;
fallbackToLocal?: boolean;
completedSegmentTTL?: number;
fileWaitTimeout?: number;
}
//# sourceMappingURL=interfaces.d.ts.map