mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Handle videos with FPS < 1
This commit is contained in:
parent
67c1f1985f
commit
4ea659d569
4 changed files with 22 additions and 10 deletions
|
@ -18,13 +18,15 @@ export function computeOutputFPS (options: {
|
|||
fps = getClosestFramerateStandard({ fps, type: 'STANDARD' })
|
||||
}
|
||||
|
||||
// Hard FPS limits
|
||||
if (fps > VIDEO_TRANSCODING_FPS.MAX) fps = getClosestFramerateStandard({ fps, type: 'HD_STANDARD' })
|
||||
|
||||
if (fps < VIDEO_TRANSCODING_FPS.MIN) {
|
||||
throw new Error(`Cannot compute FPS because ${fps} is lower than our minimum value ${VIDEO_TRANSCODING_FPS.MIN}`)
|
||||
if (fps < VIDEO_TRANSCODING_FPS.HARD_MIN) {
|
||||
throw new Error(`Cannot compute FPS because ${fps} is lower than our minimum value ${VIDEO_TRANSCODING_FPS.HARD_MIN}`)
|
||||
}
|
||||
|
||||
// Cap min FPS
|
||||
if (fps < VIDEO_TRANSCODING_FPS.SOFT_MIN) fps = VIDEO_TRANSCODING_FPS.SOFT_MIN
|
||||
// Cap max FPS
|
||||
if (fps > VIDEO_TRANSCODING_FPS.SOFT_MAX) fps = getClosestFramerateStandard({ fps, type: 'HD_STANDARD' })
|
||||
|
||||
return fps
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue