2023-05-22 14:07:43 -04:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
2023-06-16 15:54:17 -04:00
|
|
|
import { Type } from 'class-transformer';
|
2024-03-07 22:59:02 -05:00
|
|
|
import { IsEnum, IsInt, IsString, Max, Min } from 'class-validator';
|
2024-03-20 19:32:04 +01:00
|
|
|
import {
|
|
|
|
|
AudioCodec,
|
|
|
|
|
CQMode,
|
|
|
|
|
ToneMapping,
|
|
|
|
|
TranscodeHWAccel,
|
|
|
|
|
TranscodePolicy,
|
|
|
|
|
VideoCodec,
|
2024-03-20 16:02:51 -05:00
|
|
|
} from 'src/entities/system-config.entity';
|
2024-03-20 15:04:03 -05:00
|
|
|
import { ValidateBoolean } from 'src/validation';
|
2022-12-09 15:51:42 -05:00
|
|
|
|
|
|
|
|
export class SystemConfigFFmpegDto {
|
2023-05-22 14:07:43 -04: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 15:51:42 -05:00
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
|
preset!: string;
|
|
|
|
|
|
2023-07-08 22:43:11 -04:00
|
|
|
@IsEnum(VideoCodec)
|
|
|
|
|
@ApiProperty({ enumName: 'VideoCodec', enum: VideoCodec })
|
|
|
|
|
targetVideoCodec!: VideoCodec;
|
2022-12-09 15:51:42 -05:00
|
|
|
|
2024-01-26 18:02:56 +01:00
|
|
|
@IsEnum(VideoCodec, { each: true })
|
|
|
|
|
@ApiProperty({ enumName: 'VideoCodec', enum: VideoCodec, isArray: true })
|
|
|
|
|
acceptedVideoCodecs!: VideoCodec[];
|
|
|
|
|
|
2023-07-08 22:43:11 -04:00
|
|
|
@IsEnum(AudioCodec)
|
|
|
|
|
@ApiProperty({ enumName: 'AudioCodec', enum: AudioCodec })
|
|
|
|
|
targetAudioCodec!: AudioCodec;
|
2022-12-09 15:51:42 -05: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 15:51:42 -05:00
|
|
|
@IsString()
|
2023-04-04 02:42:53 +01:00
|
|
|
targetResolution!: string;
|
2023-01-22 02:09:02 +00:00
|
|
|
|
2023-05-22 14:07:43 -04:00
|
|
|
@IsString()
|
|
|
|
|
maxBitrate!: string;
|
|
|
|
|
|
2023-09-02 21:22:42 -04: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;
|
|
|
|
|
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean()
|
2023-09-02 21:22:42 -04:00
|
|
|
temporalAQ!: boolean;
|
|
|
|
|
|
|
|
|
|
@IsEnum(CQMode)
|
|
|
|
|
@ApiProperty({ enumName: 'CQMode', enum: CQMode })
|
|
|
|
|
cqMode!: CQMode;
|
|
|
|
|
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean()
|
2023-05-22 14:07:43 -04:00
|
|
|
twoPass!: boolean;
|
|
|
|
|
|
2024-01-30 02:40:02 +01:00
|
|
|
@IsString()
|
|
|
|
|
preferredHwDevice!: string;
|
|
|
|
|
|
2023-07-08 22:43:11 -04:00
|
|
|
@IsEnum(TranscodePolicy)
|
|
|
|
|
@ApiProperty({ enumName: 'TranscodePolicy', enum: TranscodePolicy })
|
|
|
|
|
transcode!: TranscodePolicy;
|
2023-08-01 21:56:10 -04:00
|
|
|
|
|
|
|
|
@IsEnum(TranscodeHWAccel)
|
|
|
|
|
@ApiProperty({ enumName: 'TranscodeHWAccel', enum: TranscodeHWAccel })
|
|
|
|
|
accel!: TranscodeHWAccel;
|
2023-08-07 16:35:25 -04:00
|
|
|
|
|
|
|
|
@IsEnum(ToneMapping)
|
|
|
|
|
@ApiProperty({ enumName: 'ToneMapping', enum: ToneMapping })
|
|
|
|
|
tonemap!: ToneMapping;
|
2022-12-09 15:51:42 -05:00
|
|
|
}
|