mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-12-08 04:09:07 +00:00
refactor(server): video transcode processor (#2163)
* refactor(server): video transcode processor * refactor: rename shouldRotate to isVideoVertical, remove unnecessary await * refactor: rename getOptions to getFfmpegOptions to be clearer in that context * fix: optimal preset converting vertical videos already smaller than target resolution --------- Co-authored-by: Zack Pollard <zackpollard@ymail.com>
This commit is contained in:
@@ -5,8 +5,26 @@ export interface ResizeOptions {
|
||||
format: 'webp' | 'jpeg';
|
||||
}
|
||||
|
||||
export interface IMediaRepository {
|
||||
resize(input: string, output: string, options: ResizeOptions): Promise<void>;
|
||||
extractVideoThumbnail(input: string, output: string, size: number): Promise<void>;
|
||||
extractThumbnailFromExif(input: string, output: string): Promise<void>;
|
||||
export interface VideoStreamInfo {
|
||||
height: number;
|
||||
width: number;
|
||||
rotation: number;
|
||||
codecName?: string;
|
||||
codecType?: string;
|
||||
frameCount: number;
|
||||
}
|
||||
|
||||
export interface VideoInfo {
|
||||
streams: VideoStreamInfo[];
|
||||
}
|
||||
|
||||
export interface IMediaRepository {
|
||||
// image
|
||||
extractThumbnailFromExif(input: string, output: string): Promise<void>;
|
||||
resize(input: string, output: string, options: ResizeOptions): Promise<void>;
|
||||
|
||||
// video
|
||||
extractVideoThumbnail(input: string, output: string, size: number): Promise<void>;
|
||||
probe(input: string): Promise<VideoInfo>;
|
||||
transcode(input: string, output: string, options: any): Promise<void>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user