2023-07-31 14:34:36 +02:00
|
|
|
import { CONFIG } from '@server/initializers/config.js'
|
|
|
|
import { MUserId, MVideoFile, MVideoFullLight } from '@server/types/models/index.js'
|
|
|
|
import { TranscodingJobQueueBuilder, TranscodingRunnerJobBuilder } from './shared/index.js'
|
2023-04-21 14:55:10 +02:00
|
|
|
|
|
|
|
export function createOptimizeOrMergeAudioJobs (options: {
|
|
|
|
video: MVideoFullLight
|
|
|
|
videoFile: MVideoFile
|
|
|
|
isNewVideo: boolean
|
|
|
|
user: MUserId
|
2023-05-02 13:38:00 +02:00
|
|
|
videoFileAlreadyLocked: boolean
|
2023-04-21 14:55:10 +02:00
|
|
|
}) {
|
|
|
|
return getJobBuilder().createOptimizeOrMergeAudioJobs(options)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export function createTranscodingJobs (options: {
|
2024-11-04 10:16:31 +01:00
|
|
|
transcodingType: 'hls' | 'web-video'
|
2023-04-21 14:55:10 +02:00
|
|
|
video: MVideoFullLight
|
|
|
|
resolutions: number[]
|
|
|
|
isNewVideo: boolean
|
|
|
|
user: MUserId
|
|
|
|
}) {
|
|
|
|
return getJobBuilder().createTranscodingJobs(options)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// Private
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
function getJobBuilder () {
|
|
|
|
if (CONFIG.TRANSCODING.REMOTE_RUNNERS.ENABLED === true) {
|
|
|
|
return new TranscodingRunnerJobBuilder()
|
|
|
|
}
|
|
|
|
|
|
|
|
return new TranscodingJobQueueBuilder()
|
|
|
|
}
|