1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Add ability to run transcoding jobs

This commit is contained in:
Chocobozzz 2021-11-18 14:35:08 +01:00
parent b46cf4b920
commit ad5db1044c
No known key found for this signature in database
GPG key ID: 583A612D890159BE
54 changed files with 715 additions and 103 deletions

View file

@ -206,7 +206,7 @@ async function getVideoStreamFromFile (path: string, existingProbe?: FfprobeData
return metadata.streams.find(s => s.codec_type === 'video') || null
}
function computeResolutionsToTranscode (videoFileResolution: number, type: 'vod' | 'live') {
function computeLowerResolutionsToTranscode (videoFileResolution: number, type: 'vod' | 'live') {
const configResolutions = type === 'vod'
? CONFIG.TRANSCODING.RESOLUTIONS
: CONFIG.LIVE.TRANSCODING.RESOLUTIONS
@ -214,7 +214,7 @@ function computeResolutionsToTranscode (videoFileResolution: number, type: 'vod'
const resolutionsEnabled: number[] = []
// Put in the order we want to proceed jobs
const resolutions = [
const resolutions: VideoResolution[] = [
VideoResolution.H_NOVIDEO,
VideoResolution.H_480P,
VideoResolution.H_360P,
@ -327,7 +327,7 @@ export {
getVideoFileFPS,
ffprobePromise,
getClosestFramerateStandard,
computeResolutionsToTranscode,
computeLowerResolutionsToTranscode,
getVideoFileBitrate,
canDoQuickTranscode,
canDoQuickVideoTranscode,