2023-02-25 09:12:03 -05:00
|
|
|
export const IMediaRepository = 'IMediaRepository';
|
|
|
|
|
|
|
|
|
|
export interface ResizeOptions {
|
|
|
|
|
size: number;
|
|
|
|
|
format: 'webp' | 'jpeg';
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-04 10:48:02 -04:00
|
|
|
export interface VideoStreamInfo {
|
|
|
|
|
height: number;
|
|
|
|
|
width: number;
|
|
|
|
|
rotation: number;
|
|
|
|
|
codecName?: string;
|
|
|
|
|
codecType?: string;
|
|
|
|
|
frameCount: number;
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-06 04:32:59 +01:00
|
|
|
export interface AudioStreamInfo {
|
|
|
|
|
codecName?: string;
|
|
|
|
|
codecType?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface VideoFormat {
|
|
|
|
|
formatName?: string;
|
|
|
|
|
formatLongName?: string;
|
|
|
|
|
duration: number;
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-04 10:48:02 -04:00
|
|
|
export interface VideoInfo {
|
2023-04-06 04:32:59 +01:00
|
|
|
format: VideoFormat;
|
|
|
|
|
videoStreams: VideoStreamInfo[];
|
|
|
|
|
audioStreams: AudioStreamInfo[];
|
2023-04-04 10:48:02 -04:00
|
|
|
}
|
|
|
|
|
|
2023-02-25 09:12:03 -05:00
|
|
|
export interface IMediaRepository {
|
2023-04-04 10:48:02 -04:00
|
|
|
// image
|
|
|
|
|
extractThumbnailFromExif(input: string, output: string): Promise<void>;
|
2023-02-25 09:12:03 -05:00
|
|
|
resize(input: string, output: string, options: ResizeOptions): Promise<void>;
|
2023-04-04 10:48:02 -04:00
|
|
|
|
|
|
|
|
// video
|
2023-04-04 04:18:27 +03:00
|
|
|
extractVideoThumbnail(input: string, output: string, size: number): Promise<void>;
|
2023-04-04 10:48:02 -04:00
|
|
|
probe(input: string): Promise<VideoInfo>;
|
|
|
|
|
transcode(input: string, output: string, options: any): Promise<void>;
|
2023-02-25 09:12:03 -05:00
|
|
|
}
|