mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(server,web): system config for admin (#959)
* feat: add admin config module for user configured config, uses it for ffmpeg * feat: add api endpoint to retrieve admin config settings and values * feat: add settings panel to admin page on web (wip) * feat: add api endpoint to update the admin config * chore: re-generate openapi spec after rebase * refactor: move from admin config to system config naming * chore: move away from UseGuards to new @Authenticated decorator * style: dark mode styling for lists and fix conflicting colors * wip: 2 column design, no edit button * refactor: system config * chore: generate open api * chore: rm broken test * chore: cleanup types * refactor: config module names Co-authored-by: Zack Pollard <zackpollard@ymail.com> Co-authored-by: Zack Pollard <zack.pollard@moonpig.com>
This commit is contained in:
parent
d3c35ec9c5
commit
b5d75e2016
52 changed files with 2062 additions and 38 deletions
|
|
@ -9,6 +9,7 @@ import { InjectRepository } from '@nestjs/typeorm';
|
|||
import { Job } from 'bull';
|
||||
import ffmpeg from 'fluent-ffmpeg';
|
||||
import { existsSync, mkdirSync } from 'fs';
|
||||
import { ImmichConfigService } from 'libs/immich-config/src';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
@Processor(QueueNameEnum.VIDEO_CONVERSION)
|
||||
|
|
@ -16,6 +17,7 @@ export class VideoTranscodeProcessor {
|
|||
constructor(
|
||||
@InjectRepository(AssetEntity)
|
||||
private assetRepository: Repository<AssetEntity>,
|
||||
private immichConfigService: ImmichConfigService,
|
||||
) {}
|
||||
|
||||
@Process({ name: mp4ConversionProcessorName, concurrency: 1 })
|
||||
|
|
@ -40,9 +42,17 @@ export class VideoTranscodeProcessor {
|
|||
}
|
||||
|
||||
async runFFMPEGPipeLine(asset: AssetEntity, savedEncodedPath: string): Promise<void> {
|
||||
const config = await this.immichConfigService.getSystemConfigMap();
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
ffmpeg(asset.originalPath)
|
||||
.outputOptions(['-crf 23', '-preset ultrafast', '-vcodec libx264', '-acodec mp3', '-vf scale=1280:-2'])
|
||||
.outputOptions([
|
||||
`-crf ${config.ffmpeg_crf}`,
|
||||
`-preset ${config.ffmpeg_preset}`,
|
||||
`-vcodec ${config.ffmpeg_target_video_codec}`,
|
||||
`-acodec ${config.ffmpeg_target_audio_codec}`,
|
||||
`-vf scale=${config.ffmpeg_target_scaling}`,
|
||||
])
|
||||
.output(savedEncodedPath)
|
||||
.on('start', () => {
|
||||
Logger.log('Start Converting Video', 'mp4Conversion');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue