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:
parent
7fcc5a5417
commit
0a9b632e48
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 = {
|
||||
Mp3: 'mp3',
|
||||
Aac: 'aac',
|
||||
Opus: 'opus'
|
||||
Libopus: 'libopus'
|
||||
} as const;
|
||||
|
||||
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": [
|
||||
"mp3",
|
||||
"aac",
|
||||
"opus"
|
||||
"libopus"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -99,7 +99,7 @@ export enum VideoCodec {
|
||||
export enum AudioCodec {
|
||||
MP3 = 'mp3',
|
||||
AAC = 'aac',
|
||||
OPUS = 'opus',
|
||||
LIBOPUS = 'libopus',
|
||||
}
|
||||
|
||||
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 = {
|
||||
Mp3: 'mp3',
|
||||
Aac: 'aac',
|
||||
Opus: 'opus'
|
||||
Libopus: 'libopus'
|
||||
} as const;
|
||||
|
||||
export type AudioCodec = typeof AudioCodec[keyof typeof AudioCodec];
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user