Don't use min FPS, throw instead

Avoir creating a big output from a very low FPS input file
pull/4626/head
Chocobozzz 2021-10-12 10:37:25 +02:00
parent 9f430a53be
commit f7bb2bb5a7
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 5 additions and 2 deletions

View File

@ -302,7 +302,10 @@ function computeFPS (fpsArg: number, resolution: VideoResolution) {
// Hard FPS limits // Hard FPS limits
if (fps > VIDEO_TRANSCODING_FPS.MAX) fps = getClosestFramerateStandard(fps, 'HD_STANDARD') if (fps > VIDEO_TRANSCODING_FPS.MAX) fps = getClosestFramerateStandard(fps, 'HD_STANDARD')
else if (fps < VIDEO_TRANSCODING_FPS.MIN) fps = VIDEO_TRANSCODING_FPS.MIN
if (fps < VIDEO_TRANSCODING_FPS.MIN) {
throw new Error(`Cannot compute FPS because ${fps} is lower than our minimum value ${VIDEO_TRANSCODING_FPS.MIN}`)
}
return fps return fps
} }

View File

@ -346,7 +346,7 @@ const VIEW_LIFETIME = {
let CONTACT_FORM_LIFETIME = 60000 * 60 // 1 hour let CONTACT_FORM_LIFETIME = 60000 * 60 // 1 hour
const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = { const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = {
MIN: 10, MIN: 1,
STANDARD: [ 24, 25, 30 ], STANDARD: [ 24, 25, 30 ],
HD_STANDARD: [ 50, 60 ], HD_STANDARD: [ 50, 60 ],
AVERAGE: 30, AVERAGE: 30,