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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface VideoInfo {
|
|
|
|
|
streams: VideoStreamInfo[];
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
}
|