mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 16:41:59 +00: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:
parent
7fcc5a5417
commit
0a9b632e48
7 changed files with 26 additions and 5 deletions
2
cli/src/api/open-api/api.ts
generated
2
cli/src/api/open-api/api.ts
generated
|
@ -752,7 +752,7 @@ export type AssetTypeEnum = typeof AssetTypeEnum[keyof typeof AssetTypeEnum];
|
||||||
export const AudioCodec = {
|
export const AudioCodec = {
|
||||||
Mp3: 'mp3',
|
Mp3: 'mp3',
|
||||||
Aac: 'aac',
|
Aac: 'aac',
|
||||||
Opus: 'opus'
|
Libopus: 'libopus'
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type AudioCodec = typeof AudioCodec[keyof typeof AudioCodec];
|
export type AudioCodec = typeof AudioCodec[keyof typeof AudioCodec];
|
||||||
|
|
BIN
mobile/openapi/lib/model/audio_codec.dart
generated
BIN
mobile/openapi/lib/model/audio_codec.dart
generated
Binary file not shown.
|
@ -5318,7 +5318,7 @@
|
||||||
"enum": [
|
"enum": [
|
||||||
"mp3",
|
"mp3",
|
||||||
"aac",
|
"aac",
|
||||||
"opus"
|
"libopus"
|
||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
@ -99,7 +99,7 @@ export enum VideoCodec {
|
||||||
export enum AudioCodec {
|
export enum AudioCodec {
|
||||||
MP3 = 'mp3',
|
MP3 = 'mp3',
|
||||||
AAC = 'aac',
|
AAC = 'aac',
|
||||||
OPUS = 'opus',
|
LIBOPUS = 'libopus',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum TranscodeHWAccel {
|
export enum TranscodeHWAccel {
|
||||||
|
|
|
@ -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"'
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
}
|
2
web/src/api/open-api/api.ts
generated
2
web/src/api/open-api/api.ts
generated
|
@ -752,7 +752,7 @@ export type AssetTypeEnum = typeof AssetTypeEnum[keyof typeof AssetTypeEnum];
|
||||||
export const AudioCodec = {
|
export const AudioCodec = {
|
||||||
Mp3: 'mp3',
|
Mp3: 'mp3',
|
||||||
Aac: 'aac',
|
Aac: 'aac',
|
||||||
Opus: 'opus'
|
Libopus: 'libopus'
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type AudioCodec = typeof AudioCodec[keyof typeof AudioCodec];
|
export type AudioCodec = typeof AudioCodec[keyof typeof AudioCodec];
|
||||||
|
|
|
@ -145,7 +145,7 @@
|
||||||
options={[
|
options={[
|
||||||
{ value: AudioCodec.Aac, text: 'aac' },
|
{ value: AudioCodec.Aac, text: 'aac' },
|
||||||
{ value: AudioCodec.Mp3, text: 'mp3' },
|
{ value: AudioCodec.Mp3, text: 'mp3' },
|
||||||
{ value: AudioCodec.Opus, text: 'opus' },
|
{ value: AudioCodec.Libopus, text: 'opus' },
|
||||||
]}
|
]}
|
||||||
name="acodec"
|
name="acodec"
|
||||||
isEdited={ffmpegConfig.targetAudioCodec !== savedConfig.targetAudioCodec}
|
isEdited={ffmpegConfig.targetAudioCodec !== savedConfig.targetAudioCodec}
|
||||||
|
|
Loading…
Reference in a new issue