Fix retranscoding of odd resolution
This commit is contained in:
parent
c0a9de6652
commit
f30ef8cf98
2 changed files with 9 additions and 3 deletions
|
@ -15,6 +15,7 @@ import {
|
|||
import { VideoResolution, VideoTranscodingFPS } from '@shared/models'
|
||||
import { CONFIG } from '../../initializers/config'
|
||||
import { VIDEO_TRANSCODING_FPS } from '../../initializers/constants'
|
||||
import { toEven } from '../core-utils'
|
||||
import { logger } from '../logger'
|
||||
|
||||
/**
|
||||
|
@ -133,7 +134,8 @@ function computeResolutionsToTranscode (options: {
|
|||
}
|
||||
|
||||
if (includeInput) {
|
||||
resolutionsEnabled.add(input)
|
||||
// Always use an even resolution to avoid issues with ffmpeg
|
||||
resolutionsEnabled.add(toEven(input))
|
||||
}
|
||||
|
||||
return Array.from(resolutionsEnabled)
|
||||
|
|
|
@ -444,7 +444,9 @@ async function generateHlsPlaylistCommon (options: {
|
|||
}
|
||||
|
||||
function buildOriginalFileResolution (inputResolution: number) {
|
||||
if (CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION === true) return toEven(inputResolution)
|
||||
if (CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION === true) {
|
||||
return toEven(inputResolution)
|
||||
}
|
||||
|
||||
const resolutions = computeResolutionsToTranscode({
|
||||
input: inputResolution,
|
||||
|
@ -455,7 +457,9 @@ function buildOriginalFileResolution (inputResolution: number) {
|
|||
hasAudio: true
|
||||
})
|
||||
|
||||
if (resolutions.length === 0) return toEven(inputResolution)
|
||||
if (resolutions.length === 0) {
|
||||
return toEven(inputResolution)
|
||||
}
|
||||
|
||||
return Math.max(...resolutions)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue