mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-12-08 20:29:05 +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:
@@ -19,6 +19,7 @@ import {
|
||||
AssetEntity,
|
||||
AssetFaceEntity,
|
||||
AssetType,
|
||||
AudioCodec,
|
||||
ExifEntity,
|
||||
PartnerEntity,
|
||||
PersonEntity,
|
||||
@@ -27,9 +28,10 @@ import {
|
||||
SystemConfig,
|
||||
TagEntity,
|
||||
TagType,
|
||||
TranscodePreset,
|
||||
TranscodePolicy,
|
||||
UserEntity,
|
||||
UserTokenEntity,
|
||||
VideoCodec,
|
||||
} from '@app/infra/entities';
|
||||
|
||||
const today = new Date();
|
||||
@@ -685,12 +687,12 @@ export const systemConfigStub = {
|
||||
crf: 23,
|
||||
threads: 0,
|
||||
preset: 'ultrafast',
|
||||
targetAudioCodec: 'aac',
|
||||
targetAudioCodec: AudioCodec.AAC,
|
||||
targetResolution: '720',
|
||||
targetVideoCodec: 'h264',
|
||||
targetVideoCodec: VideoCodec.H264,
|
||||
maxBitrate: '0',
|
||||
twoPass: false,
|
||||
transcode: TranscodePreset.REQUIRED,
|
||||
transcode: TranscodePolicy.REQUIRED,
|
||||
},
|
||||
job: {
|
||||
[QueueName.BACKGROUND_TASK]: { concurrency: 5 },
|
||||
|
||||
Reference in New Issue
Block a user