mirror of
https://github.com/immich-app/immich.git
synced 2026-03-06 18:17:27 +03:00
chore: refactor transcode config routing (#9800)
* chore: refactor transcode config * rename parameter * handle no /dev/dri * prefer undefined
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
IMediaRepository,
|
||||
ImageDimensions,
|
||||
ThumbnailOptions,
|
||||
TranscodeOptions,
|
||||
TranscodeCommand,
|
||||
VideoInfo,
|
||||
} from 'src/interfaces/media.interface';
|
||||
import { Instrumentation } from 'src/utils/instrumentation';
|
||||
@@ -97,7 +97,7 @@ export class MediaRepository implements IMediaRepository {
|
||||
};
|
||||
}
|
||||
|
||||
transcode(input: string, output: string | Writable, options: TranscodeOptions): Promise<void> {
|
||||
transcode(input: string, output: string | Writable, options: TranscodeCommand): Promise<void> {
|
||||
if (!options.twoPass) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.configureFfmpegCall(input, output, options).on('error', reject).on('end', resolve).run();
|
||||
@@ -150,7 +150,7 @@ export class MediaRepository implements IMediaRepository {
|
||||
return { width, height };
|
||||
}
|
||||
|
||||
private configureFfmpegCall(input: string, output: string | Writable, options: TranscodeOptions) {
|
||||
private configureFfmpegCall(input: string, output: string | Writable, options: TranscodeCommand) {
|
||||
return ffmpeg(input, { niceness: 10 })
|
||||
.inputOptions(options.inputOptions)
|
||||
.outputOptions(options.outputOptions)
|
||||
|
||||
Reference in New Issue
Block a user