1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

fix(server): use libopus for transcoding (#4102)

* updated audio codec enum

* added migration

* updated api

* fixed enum

* formatting

* simplified migration
This commit is contained in:
Mert 2023-09-15 20:52:45 -04:00 committed by GitHub
parent 7fcc5a5417
commit 0a9b632e48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 5 deletions

View File

@ -752,7 +752,7 @@ export type AssetTypeEnum = typeof AssetTypeEnum[keyof typeof AssetTypeEnum];
export const AudioCodec = {
Mp3: 'mp3',
Aac: 'aac',
Opus: 'opus'
Libopus: 'libopus'
} as const;
export type AudioCodec = typeof AudioCodec[keyof typeof AudioCodec];

Binary file not shown.

View File

@ -5318,7 +5318,7 @@
"enum": [
"mp3",
"aac",
"opus"
"libopus"
],
"type": "string"
},

View File

@ -99,7 +99,7 @@ export enum VideoCodec {
export enum AudioCodec {
MP3 = 'mp3',
AAC = 'aac',
OPUS = 'opus',
LIBOPUS = 'libopus',
}
export enum TranscodeHWAccel {

View File

@ -0,0 +1,21 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateOpusCodecToLibopus1694758412194 implements MigrationInterface {
name = 'UpdateOpusCodecToLibopus1694758412194'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
UPDATE system_config
SET value = '"libopus"'
WHERE key = 'ffmpeg.targetAudioCodec' AND value = '"opus"'
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
UPDATE system_config
SET value = '"opus"'
WHERE key = 'ffmpeg.targetAudioCodec' AND value = '"libopus"'
`);
}
}

View File

@ -752,7 +752,7 @@ export type AssetTypeEnum = typeof AssetTypeEnum[keyof typeof AssetTypeEnum];
export const AudioCodec = {
Mp3: 'mp3',
Aac: 'aac',
Opus: 'opus'
Libopus: 'libopus'
} as const;
export type AudioCodec = typeof AudioCodec[keyof typeof AudioCodec];

View File

@ -145,7 +145,7 @@
options={[
{ value: AudioCodec.Aac, text: 'aac' },
{ value: AudioCodec.Mp3, text: 'mp3' },
{ value: AudioCodec.Opus, text: 'opus' },
{ value: AudioCodec.Libopus, text: 'opus' },
]}
name="acodec"
isEdited={ffmpegConfig.targetAudioCodec !== savedConfig.targetAudioCodec}