2023-04-21 07:55:10 -05:00
|
|
|
import { CONFIG } from '@server/initializers/config'
|
|
|
|
import { MUserId, MVideoFile, MVideoFullLight } from '@server/types/models'
|
|
|
|
import { TranscodingJobQueueBuilder, TranscodingRunnerJobBuilder } from './shared'
|
|
|
|
|
|
|
|
export function createOptimizeOrMergeAudioJobs (options: {
|
|
|
|
video: MVideoFullLight
|
|
|
|
videoFile: MVideoFile
|
|
|
|
isNewVideo: boolean
|
|
|
|
user: MUserId
|
2023-05-02 06:38:00 -05:00
|
|
|
videoFileAlreadyLocked: boolean
|
2023-04-21 07:55:10 -05:00
|
|
|
}) {
|
|
|
|
return getJobBuilder().createOptimizeOrMergeAudioJobs(options)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export function createTranscodingJobs (options: {
|
|
|
|
transcodingType: 'hls' | 'webtorrent'
|
|
|
|
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()
|
|
|
|
}
|