2023-09-03 03:22:42 +02:00
|
|
|
import { AudioCodec, CQMode, ToneMapping, TranscodeHWAccel, TranscodePolicy, VideoCodec } from '@app/infra/entities';
|
2023-05-22 20:07:43 +02:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
2023-06-16 21:54:17 +02:00
|
|
|
import { Type } from 'class-transformer';
|
|
|
|
import { IsBoolean, IsEnum, IsInt, IsString, Max, Min } from 'class-validator';
|
2022-12-09 21:51:42 +01:00
|
|
|
|
|
|
|
export class SystemConfigFFmpegDto {
|
2023-05-22 20:07:43 +02:00
|
|
|
@IsInt()
|
|
|
|
@Min(0)
|
|
|
|
@Max(51)
|
|
|
|
@Type(() => Number)
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
crf!: number;
|
|
|
|
|
|
|
|
@IsInt()
|
|
|
|
@Min(0)
|
|
|
|
@Type(() => Number)
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
threads!: number;
|
2022-12-09 21:51:42 +01:00
|
|
|
|
|
|
|
@IsString()
|
|
|
|
preset!: string;
|
|
|
|
|
2023-07-09 04:43:11 +02:00
|
|
|
@IsEnum(VideoCodec)
|
|
|
|
@ApiProperty({ enumName: 'VideoCodec', enum: VideoCodec })
|
|
|
|
targetVideoCodec!: VideoCodec;
|
2022-12-09 21:51:42 +01:00
|
|
|
|
2024-01-26 18:02:56 +01:00
|
|
|
@IsEnum(VideoCodec, { each: true })
|
|
|
|
@ApiProperty({ enumName: 'VideoCodec', enum: VideoCodec, isArray: true })
|
|
|
|
acceptedVideoCodecs!: VideoCodec[];
|
|
|
|
|
2023-07-09 04:43:11 +02:00
|
|
|
@IsEnum(AudioCodec)
|
|
|
|
@ApiProperty({ enumName: 'AudioCodec', enum: AudioCodec })
|
|
|
|
targetAudioCodec!: AudioCodec;
|
2022-12-09 21:51:42 +01:00
|
|
|
|
2024-01-26 18:02:56 +01:00
|
|
|
@IsEnum(AudioCodec, { each: true })
|
|
|
|
@ApiProperty({ enumName: 'AudioCodec', enum: AudioCodec, isArray: true })
|
|
|
|
acceptedAudioCodecs!: AudioCodec[];
|
|
|
|
|
2022-12-09 21:51:42 +01:00
|
|
|
@IsString()
|
2023-04-04 03:42:53 +02:00
|
|
|
targetResolution!: string;
|
2023-01-22 03:09:02 +01:00
|
|
|
|
2023-05-22 20:07:43 +02:00
|
|
|
@IsString()
|
|
|
|
maxBitrate!: string;
|
|
|
|
|
2023-09-03 03:22:42 +02:00
|
|
|
@IsInt()
|
|
|
|
@Min(-1)
|
|
|
|
@Max(16)
|
|
|
|
@Type(() => Number)
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
bframes!: number;
|
|
|
|
|
|
|
|
@IsInt()
|
|
|
|
@Min(0)
|
|
|
|
@Max(6)
|
|
|
|
@Type(() => Number)
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
refs!: number;
|
|
|
|
|
|
|
|
@IsInt()
|
|
|
|
@Min(0)
|
|
|
|
@Type(() => Number)
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
gopSize!: number;
|
|
|
|
|
|
|
|
@IsInt()
|
|
|
|
@Min(0)
|
|
|
|
@Type(() => Number)
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
npl!: number;
|
|
|
|
|
|
|
|
@IsBoolean()
|
|
|
|
temporalAQ!: boolean;
|
|
|
|
|
|
|
|
@IsEnum(CQMode)
|
|
|
|
@ApiProperty({ enumName: 'CQMode', enum: CQMode })
|
|
|
|
cqMode!: CQMode;
|
|
|
|
|
2023-05-22 20:07:43 +02:00
|
|
|
@IsBoolean()
|
|
|
|
twoPass!: boolean;
|
|
|
|
|
2023-07-09 04:43:11 +02:00
|
|
|
@IsEnum(TranscodePolicy)
|
|
|
|
@ApiProperty({ enumName: 'TranscodePolicy', enum: TranscodePolicy })
|
|
|
|
transcode!: TranscodePolicy;
|
2023-08-02 03:56:10 +02:00
|
|
|
|
|
|
|
@IsEnum(TranscodeHWAccel)
|
|
|
|
@ApiProperty({ enumName: 'TranscodeHWAccel', enum: TranscodeHWAccel })
|
|
|
|
accel!: TranscodeHWAccel;
|
2023-08-07 22:35:25 +02:00
|
|
|
|
|
|
|
@IsEnum(ToneMapping)
|
|
|
|
@ApiProperty({ enumName: 'ToneMapping', enum: ToneMapping })
|
|
|
|
tonemap!: ToneMapping;
|
2022-12-09 21:51:42 +01:00
|
|
|
}
|