2023-07-08 22:43:11 -04:00
|
|
|
import { AudioCodec, TranscodePolicy, VideoCodec } from '@app/infra/entities';
|
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';
|
|
|
|
|
import { IsBoolean, IsEnum, IsInt, IsString, Max, Min } from 'class-validator';
|
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
|
|
|
|
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
|
|
|
|
|
|
|
|
@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;
|
|
|
|
|
|
|
|
|
|
@IsBoolean()
|
|
|
|
|
twoPass!: boolean;
|
|
|
|
|
|
2023-07-08 22:43:11 -04:00
|
|
|
@IsEnum(TranscodePolicy)
|
|
|
|
|
@ApiProperty({ enumName: 'TranscodePolicy', enum: TranscodePolicy })
|
|
|
|
|
transcode!: TranscodePolicy;
|
2022-12-09 15:51:42 -05:00
|
|
|
}
|