aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/transcoding/create-transcoding-job.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/transcoding/create-transcoding-job.ts')
-rw-r--r--server/lib/transcoding/create-transcoding-job.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/server/lib/transcoding/create-transcoding-job.ts b/server/lib/transcoding/create-transcoding-job.ts
new file mode 100644
index 000000000..46831a912
--- /dev/null
+++ b/server/lib/transcoding/create-transcoding-job.ts
@@ -0,0 +1,36 @@
1import { CONFIG } from '@server/initializers/config'
2import { MUserId, MVideoFile, MVideoFullLight } from '@server/types/models'
3import { TranscodingJobQueueBuilder, TranscodingRunnerJobBuilder } from './shared'
4
5export function createOptimizeOrMergeAudioJobs (options: {
6 video: MVideoFullLight
7 videoFile: MVideoFile
8 isNewVideo: boolean
9 user: MUserId
10}) {
11 return getJobBuilder().createOptimizeOrMergeAudioJobs(options)
12}
13
14// ---------------------------------------------------------------------------
15
16export function createTranscodingJobs (options: {
17 transcodingType: 'hls' | 'webtorrent'
18 video: MVideoFullLight
19 resolutions: number[]
20 isNewVideo: boolean
21 user: MUserId
22}) {
23 return getJobBuilder().createTranscodingJobs(options)
24}
25
26// ---------------------------------------------------------------------------
27// Private
28// ---------------------------------------------------------------------------
29
30function getJobBuilder () {
31 if (CONFIG.TRANSCODING.REMOTE_RUNNERS.ENABLED === true) {
32 return new TranscodingRunnerJobBuilder()
33 }
34
35 return new TranscodingJobQueueBuilder()
36}