From b1149881bd7ff2f19cde39cf407512a2854196bc Mon Sep 17 00:00:00 2001 From: pyorot Date: Fri, 18 Oct 2024 13:26:16 +0100 Subject: [PATCH] feat(server): add pcm_s16le accepted audio codec (#13418) --- docs/docs/install/config-file.md | 2 +- mobile/openapi/lib/model/audio_codec.dart | Bin 2639 -> 2762 bytes open-api/immich-openapi-specs.json | 3 ++- open-api/typescript-sdk/src/fetch-client.ts | 3 ++- server/src/config.ts | 2 +- server/src/enum.ts | 1 + .../services/system-config.service.spec.ts | 2 +- .../settings/ffmpeg/ffmpeg-settings.svelte | 2 ++ 8 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/docs/install/config-file.md b/docs/docs/install/config-file.md index b789d8653f..ed902f39cf 100644 --- a/docs/docs/install/config-file.md +++ b/docs/docs/install/config-file.md @@ -19,7 +19,7 @@ The default configuration looks like this: "targetVideoCodec": "h264", "acceptedVideoCodecs": ["h264"], "targetAudioCodec": "aac", - "acceptedAudioCodecs": ["aac", "mp3", "libopus"], + "acceptedAudioCodecs": ["aac", "mp3", "libopus", "pcm_s16le"], "acceptedContainers": ["mov", "ogg", "webm"], "targetResolution": "720", "maxBitrate": "0", diff --git a/mobile/openapi/lib/model/audio_codec.dart b/mobile/openapi/lib/model/audio_codec.dart index ca195f7d06e1ac1c2fe996511a1f8b8fa1640308..ea1e96f36e00a8b2a81ed980ed593a4274e23514 100644 GIT binary patch delta 118 zcmX>va!Pc=3Z}`WO#I3P$+^LXW;v+}whE4=DVh1s`6;Q%dhr@X>Oh(JVvyA2B}`ph n3JNflo3)q~*mRQldR}D13Z}{TnA$cMG0U)RKFZ0;2mob42j>6) diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index 415cc663f4..b99da367b8 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -8507,7 +8507,8 @@ "enum": [ "mp3", "aac", - "libopus" + "libopus", + "pcm_s16le" ], "type": "string" }, diff --git a/open-api/typescript-sdk/src/fetch-client.ts b/open-api/typescript-sdk/src/fetch-client.ts index 2077943bf8..17079c07c3 100644 --- a/open-api/typescript-sdk/src/fetch-client.ts +++ b/open-api/typescript-sdk/src/fetch-client.ts @@ -3501,7 +3501,8 @@ export enum TranscodeHWAccel { export enum AudioCodec { Mp3 = "mp3", Aac = "aac", - Libopus = "libopus" + Libopus = "libopus", + PcmS16Le = "pcm_s16le" } export enum VideoContainer { Mov = "mov", diff --git a/server/src/config.ts b/server/src/config.ts index b79643c501..e386c134b4 100644 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -163,7 +163,7 @@ export const defaults = Object.freeze({ targetVideoCodec: VideoCodec.H264, acceptedVideoCodecs: [VideoCodec.H264], targetAudioCodec: AudioCodec.AAC, - acceptedAudioCodecs: [AudioCodec.AAC, AudioCodec.MP3, AudioCodec.LIBOPUS], + acceptedAudioCodecs: [AudioCodec.AAC, AudioCodec.MP3, AudioCodec.LIBOPUS, AudioCodec.PCMS16LE], acceptedContainers: [VideoContainer.MOV, VideoContainer.OGG, VideoContainer.WEBM], targetResolution: '720', maxBitrate: '0', diff --git a/server/src/enum.ts b/server/src/enum.ts index 157fa0003d..8c11834dac 100644 --- a/server/src/enum.ts +++ b/server/src/enum.ts @@ -278,6 +278,7 @@ export enum AudioCodec { MP3 = 'mp3', AAC = 'aac', LIBOPUS = 'libopus', + PCMS16LE = 'pcm_s16le', } export enum VideoContainer { diff --git a/server/src/services/system-config.service.spec.ts b/server/src/services/system-config.service.spec.ts index 807d8299b8..f81abc4795 100644 --- a/server/src/services/system-config.service.spec.ts +++ b/server/src/services/system-config.service.spec.ts @@ -49,7 +49,7 @@ const updatedConfig = Object.freeze({ threads: 0, preset: 'ultrafast', targetAudioCodec: AudioCodec.AAC, - acceptedAudioCodecs: [AudioCodec.AAC, AudioCodec.MP3, AudioCodec.LIBOPUS], + acceptedAudioCodecs: [AudioCodec.AAC, AudioCodec.MP3, AudioCodec.LIBOPUS, AudioCodec.PCMS16LE], targetResolution: '720', targetVideoCodec: VideoCodec.H264, acceptedVideoCodecs: [VideoCodec.H264], diff --git a/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte b/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte index c048a22207..42cc004c52 100644 --- a/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte +++ b/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte @@ -102,6 +102,7 @@ onSelect={() => (config.ffmpeg.acceptedVideoCodecs = [config.ffmpeg.targetVideoCodec])} /> +