]>
Commit | Line | Data |
---|---|---|
1 | import { Job } from 'bullmq' | |
2 | import { getFFmpegCommandWrapperOptions } from '@server/helpers/ffmpeg' | |
3 | import { logger } from '@server/helpers/logger' | |
4 | import { FFmpegVOD } from '@shared/ffmpeg' | |
5 | import { VideoTranscodingProfilesManager } from '../default-transcoding-profiles' | |
6 | ||
7 | export function buildFFmpegVOD (job?: Job) { | |
8 | return new FFmpegVOD({ | |
9 | ...getFFmpegCommandWrapperOptions('vod', VideoTranscodingProfilesManager.Instance.getAvailableEncoders()), | |
10 | ||
11 | updateJobProgress: progress => { | |
12 | if (!job) return | |
13 | ||
14 | job.updateProgress(progress) | |
15 | .catch(err => logger.error('Cannot update ffmpeg job progress', { err })) | |
16 | } | |
17 | }) | |
18 | } |