aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/helpers/ffmpeg/ffprobe-utils.ts4
-rw-r--r--server/lib/transcoding/transcoding.ts8
2 files changed, 9 insertions, 3 deletions
diff --git a/server/helpers/ffmpeg/ffprobe-utils.ts b/server/helpers/ffmpeg/ffprobe-utils.ts
index 8cfdba4f9..fb270b3cb 100644
--- a/server/helpers/ffmpeg/ffprobe-utils.ts
+++ b/server/helpers/ffmpeg/ffprobe-utils.ts
@@ -15,6 +15,7 @@ import {
15import { VideoResolution, VideoTranscodingFPS } from '@shared/models' 15import { VideoResolution, VideoTranscodingFPS } from '@shared/models'
16import { CONFIG } from '../../initializers/config' 16import { CONFIG } from '../../initializers/config'
17import { VIDEO_TRANSCODING_FPS } from '../../initializers/constants' 17import { VIDEO_TRANSCODING_FPS } from '../../initializers/constants'
18import { toEven } from '../core-utils'
18import { logger } from '../logger' 19import { logger } from '../logger'
19 20
20/** 21/**
@@ -133,7 +134,8 @@ function computeResolutionsToTranscode (options: {
133 } 134 }
134 135
135 if (includeInput) { 136 if (includeInput) {
136 resolutionsEnabled.add(input) 137 // Always use an even resolution to avoid issues with ffmpeg
138 resolutionsEnabled.add(toEven(input))
137 } 139 }
138 140
139 return Array.from(resolutionsEnabled) 141 return Array.from(resolutionsEnabled)
diff --git a/server/lib/transcoding/transcoding.ts b/server/lib/transcoding/transcoding.ts
index e6914db87..c7b61e9ba 100644
--- a/server/lib/transcoding/transcoding.ts
+++ b/server/lib/transcoding/transcoding.ts
@@ -444,7 +444,9 @@ async function generateHlsPlaylistCommon (options: {
444} 444}
445 445
446function buildOriginalFileResolution (inputResolution: number) { 446function buildOriginalFileResolution (inputResolution: number) {
447 if (CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION === true) return toEven(inputResolution) 447 if (CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION === true) {
448 return toEven(inputResolution)
449 }
448 450
449 const resolutions = computeResolutionsToTranscode({ 451 const resolutions = computeResolutionsToTranscode({
450 input: inputResolution, 452 input: inputResolution,
@@ -455,7 +457,9 @@ function buildOriginalFileResolution (inputResolution: number) {
455 hasAudio: true 457 hasAudio: true
456 }) 458 })
457 459
458 if (resolutions.length === 0) return toEven(inputResolution) 460 if (resolutions.length === 0) {
461 return toEven(inputResolution)
462 }
459 463
460 return Math.max(...resolutions) 464 return Math.max(...resolutions)
461} 465}