mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): modularize getFfmpegOptions (#3138)
* refactored `getFfmpegOptions` refactor transcoding, make separate service * fixed enum casing * use `Logger` instead of `console.log` * review suggestions * use enum for `getHandler` * fixed formatting * Update server/src/domain/media/media.util.ts Co-authored-by: Jason Rasmussen <jrasm91@gmail.com> * Update server/src/domain/media/media.util.ts Co-authored-by: Jason Rasmussen <jrasm91@gmail.com> * More specific imports, renamed codec classes * simplified code * removed unused import * added tests * added base implementation for bitrate and threads --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
parent
27018e4ab6
commit
8349a28ed8
33 changed files with 1131 additions and 345 deletions
|
|
@ -1,9 +1,11 @@
|
|||
import {
|
||||
AudioCodec,
|
||||
SystemConfig,
|
||||
SystemConfigEntity,
|
||||
SystemConfigKey,
|
||||
SystemConfigValue,
|
||||
TranscodePreset,
|
||||
TranscodePolicy,
|
||||
VideoCodec,
|
||||
} from '@app/infra/entities';
|
||||
import { BadRequestException, Injectable, Logger } from '@nestjs/common';
|
||||
import * as _ from 'lodash';
|
||||
|
|
@ -19,12 +21,12 @@ const defaults = Object.freeze<SystemConfig>({
|
|||
crf: 23,
|
||||
threads: 0,
|
||||
preset: 'ultrafast',
|
||||
targetVideoCodec: 'h264',
|
||||
targetAudioCodec: 'aac',
|
||||
targetVideoCodec: VideoCodec.H264,
|
||||
targetAudioCodec: AudioCodec.AAC,
|
||||
targetResolution: '720',
|
||||
maxBitrate: '0',
|
||||
twoPass: false,
|
||||
transcode: TranscodePreset.REQUIRED,
|
||||
transcode: TranscodePolicy.REQUIRED,
|
||||
},
|
||||
job: {
|
||||
[QueueName.BACKGROUND_TASK]: { concurrency: 5 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue