Files
dvc-cli/src/types/index.ts

148 lines
3.1 KiB
TypeScript
Raw Normal View History

2025-11-08 19:41:20 +03:00
/**
* Configuration options for DASH conversion
*/
export interface DashConvertOptions {
/** Input video file path */
input: string;
/** Output directory path */
outputDir: string;
/** Segment duration in seconds (default: 2) */
segmentDuration?: number;
/** Video quality profiles to generate */
profiles?: VideoProfile[];
/** Enable NVENC hardware acceleration (auto-detect if undefined) */
useNvenc?: boolean;
/** Generate thumbnail sprite (default: true) */
generateThumbnails?: boolean;
/** Thumbnail sprite configuration */
thumbnailConfig?: ThumbnailConfig;
/** Parallel encoding (default: true) */
parallel?: boolean;
/** Callback for progress updates */
onProgress?: (progress: ConversionProgress) => void;
}
/**
* Video quality profile
*/
export interface VideoProfile {
/** Profile name (e.g., "1080p", "720p") */
name: string;
/** Video width in pixels */
width: number;
/** Video height in pixels */
height: number;
/** Video bitrate (e.g., "5000k") */
videoBitrate: string;
/** Audio bitrate (e.g., "128k") */
audioBitrate: string;
}
/**
* Thumbnail sprite configuration
*/
export interface ThumbnailConfig {
/** Width of each thumbnail (default: 160) */
width?: number;
/** Height of each thumbnail (default: 90) */
height?: number;
/** Interval between thumbnails in seconds (default: 1) */
interval?: number;
/** Number of thumbnails per row (default: 10) */
columns?: number;
}
/**
* Conversion progress information
*/
export interface ConversionProgress {
/** Current stage of conversion */
stage: 'analyzing' | 'encoding' | 'thumbnails' | 'manifest' | 'complete';
/** Progress percentage (0-100) - overall progress */
percent: number;
/** Current profile being processed */
currentProfile?: string;
/** Progress percentage for current profile (0-100) */
profilePercent?: number;
/** Additional message */
message?: string;
}
/**
* Result of DASH conversion
*/
export interface DashConvertResult {
/** Path to generated MPD manifest */
manifestPath: string;
/** Paths to generated video segments */
videoPaths: string[];
/** Path to thumbnail sprite (if generated) */
thumbnailSpritePath?: string;
/** Path to thumbnail VTT file (if generated) */
thumbnailVttPath?: string;
/** Video duration in seconds */
duration: number;
/** Generated profiles */
profiles: VideoProfile[];
/** Whether NVENC was used */
usedNvenc: boolean;
}
/**
* Video metadata
*/
export interface VideoMetadata {
width: number;
height: number;
duration: number;
fps: number;
codec: string;
audioBitrate?: number; // Битрейт аудио в kbps
}
/**
* Video optimizations (for future use)
*/
export interface VideoOptimizations {
/** Apply deinterlacing */
deinterlace?: boolean;
/** Apply denoising filter */
denoise?: boolean;
/** Color correction / LUT file path */
colorCorrection?: string;
/** Audio normalization */
audioNormalize?: boolean;
/** Custom FFmpeg filters */
customFilters?: string[];
}