aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts')
-rw-r--r--server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts15
1 files changed, 8 insertions, 7 deletions
diff --git a/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts b/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts
index 274dce21b..90b035402 100644
--- a/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts
+++ b/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts
@@ -8,6 +8,7 @@ import { VideoPathManager } from '@server/lib/video-path-manager'
8import { MUserId, MVideoFile, MVideoFullLight, MVideoWithFileThumbnail } from '@server/types/models' 8import { MUserId, MVideoFile, MVideoFullLight, MVideoWithFileThumbnail } from '@server/types/models'
9import { MRunnerJob } from '@server/types/models/runners' 9import { MRunnerJob } from '@server/types/models/runners'
10import { ffprobePromise, getVideoStreamDimensionsInfo, getVideoStreamFPS, hasAudioStream, isAudioFile } from '@shared/ffmpeg' 10import { ffprobePromise, getVideoStreamDimensionsInfo, getVideoStreamFPS, hasAudioStream, isAudioFile } from '@shared/ffmpeg'
11import { getTranscodingJobPriority } from '../../transcoding-priority'
11import { computeResolutionsToTranscode } from '../../transcoding-resolutions' 12import { computeResolutionsToTranscode } from '../../transcoding-resolutions'
12import { AbstractJobBuilder } from './abstract-job-builder' 13import { AbstractJobBuilder } from './abstract-job-builder'
13 14
@@ -49,7 +50,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {
49 : resolution 50 : resolution
50 51
51 const fps = computeOutputFPS({ inputFPS, resolution: maxResolution }) 52 const fps = computeOutputFPS({ inputFPS, resolution: maxResolution })
52 const priority = await this.getTranscodingJobPriority({ user, fallback: 0 }) 53 const priority = await getTranscodingJobPriority({ user, type: 'vod', fallback: 0 })
53 54
54 const mainRunnerJob = videoFile.isAudio() 55 const mainRunnerJob = videoFile.isAudio()
55 ? await new VODAudioMergeTranscodingJobHandler().create({ video, resolution: maxResolution, fps, isNewVideo, priority }) 56 ? await new VODAudioMergeTranscodingJobHandler().create({ video, resolution: maxResolution, fps, isNewVideo, priority })
@@ -63,7 +64,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {
63 fps, 64 fps,
64 isNewVideo, 65 isNewVideo,
65 dependsOnRunnerJob: mainRunnerJob, 66 dependsOnRunnerJob: mainRunnerJob,
66 priority: await this.getTranscodingJobPriority({ user, fallback: 0 }) 67 priority: await getTranscodingJobPriority({ user, type: 'vod', fallback: 0 })
67 }) 68 })
68 } 69 }
69 70
@@ -96,7 +97,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {
96 const maxResolution = Math.max(...resolutions) 97 const maxResolution = Math.max(...resolutions)
97 const { fps: inputFPS } = await video.probeMaxQualityFile() 98 const { fps: inputFPS } = await video.probeMaxQualityFile()
98 const maxFPS = computeOutputFPS({ inputFPS, resolution: maxResolution }) 99 const maxFPS = computeOutputFPS({ inputFPS, resolution: maxResolution })
99 const priority = await this.getTranscodingJobPriority({ user, fallback: 0 }) 100 const priority = await getTranscodingJobPriority({ user, type: 'vod', fallback: 0 })
100 101
101 const childrenResolutions = resolutions.filter(r => r !== maxResolution) 102 const childrenResolutions = resolutions.filter(r => r !== maxResolution)
102 103
@@ -121,7 +122,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {
121 isNewVideo, 122 isNewVideo,
122 deleteWebVideoFiles: false, 123 deleteWebVideoFiles: false,
123 dependsOnRunnerJob, 124 dependsOnRunnerJob,
124 priority: await this.getTranscodingJobPriority({ user, fallback: 0 }) 125 priority: await getTranscodingJobPriority({ user, type: 'vod', fallback: 0 })
125 }) 126 })
126 continue 127 continue
127 } 128 }
@@ -133,7 +134,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {
133 fps, 134 fps,
134 isNewVideo, 135 isNewVideo,
135 dependsOnRunnerJob, 136 dependsOnRunnerJob,
136 priority: await this.getTranscodingJobPriority({ user, fallback: 0 }) 137 priority: await getTranscodingJobPriority({ user, type: 'vod', fallback: 0 })
137 }) 138 })
138 continue 139 continue
139 } 140 }
@@ -172,7 +173,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {
172 fps, 173 fps,
173 isNewVideo, 174 isNewVideo,
174 dependsOnRunnerJob: mainRunnerJob, 175 dependsOnRunnerJob: mainRunnerJob,
175 priority: await this.getTranscodingJobPriority({ user, fallback: 0 }) 176 priority: await getTranscodingJobPriority({ user, type: 'vod', fallback: 0 })
176 }) 177 })
177 } 178 }
178 179
@@ -184,7 +185,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {
184 isNewVideo, 185 isNewVideo,
185 deleteWebVideoFiles: false, 186 deleteWebVideoFiles: false,
186 dependsOnRunnerJob: mainRunnerJob, 187 dependsOnRunnerJob: mainRunnerJob,
187 priority: await this.getTranscodingJobPriority({ user, fallback: 0 }) 188 priority: await getTranscodingJobPriority({ user, type: 'vod', fallback: 0 })
188 }) 189 })
189 } 190 }
190 } 191 }