mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Fix transcoding error
When transcoding.always_transcode_original_resolution is false
This commit is contained in:
parent
89eda2aab0
commit
29c7319c8a
4 changed files with 33 additions and 36 deletions
|
@ -2,6 +2,27 @@ import { CONFIG } from '@server/initializers/config'
|
|||
import { toEven } from '@shared/core-utils'
|
||||
import { VideoResolution } from '@shared/models'
|
||||
|
||||
export function buildOriginalFileResolution (inputResolution: number) {
|
||||
if (CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION === true) {
|
||||
return toEven(inputResolution)
|
||||
}
|
||||
|
||||
const resolutions = computeResolutionsToTranscode({
|
||||
input: inputResolution,
|
||||
type: 'vod',
|
||||
includeInput: false,
|
||||
strictLower: false,
|
||||
// We don't really care about the audio resolution in this context
|
||||
hasAudio: true
|
||||
})
|
||||
|
||||
if (resolutions.length === 0) {
|
||||
return toEven(inputResolution)
|
||||
}
|
||||
|
||||
return Math.max(...resolutions)
|
||||
}
|
||||
|
||||
export function computeResolutionsToTranscode (options: {
|
||||
input: number
|
||||
type: 'vod' | 'live'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue