Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hely0n committed Jan 7, 2025
1 parent 38f903d commit 5942d9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions server/src/services/media.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,12 @@ export class MediaService extends BaseService {
const targetRes = Number.parseInt(ffmpegConfig.targetResolution);
const isLargerThanTargetRes = scalingEnabled && Math.min(stream.height, stream.width) > targetRes;
const isLargerThanTargetBitrate = stream.bitrate > this.parseBitrateToBps(ffmpegConfig.maxBitrate);
const supportedPixelFormats: string[] = ["yuv420p", "yuvj420p", "yuva420p", "yuv420p10le"]
const supportedPixelFormats: string[] = ['yuv420p', 'yuvj420p', 'yuva420p', 'yuv420p10le'];

const isTargetVideoCodec = ffmpegConfig.acceptedVideoCodecs.includes(stream.codecName as VideoCodec);
const isTargetDynamicRange = !ffmpegConfig.transcodeHDR || !stream.isHDR;
const isRequired = !isTargetVideoCodec || !isTargetDynamicRange || !supportedPixelFormats.includes(stream.pixelFormat);
const isRequired =
!isTargetVideoCodec || !isTargetDynamicRange || !supportedPixelFormats.includes(stream.pixelFormat);

switch (ffmpegConfig.transcode) {
case TranscodePolicy.DISABLED: {
Expand Down
2 changes: 1 addition & 1 deletion server/src/utils/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class BaseConfig implements VideoCodecSWConfig {
}

if (!this.config.transcodeHDR && videoStream.isHDR) {
options.push(`format=yuv420p10le`)
options.push(`format=yuv420p10le`);
} else {
options.push(...this.getToneMapping(videoStream));
if (options.length === 0 && !videoStream.pixelFormat.endsWith('420p')) {
Expand Down

0 comments on commit 5942d9b

Please sign in to comment.