diff options
Diffstat (limited to 'server/lib/transcoding/shared/ffmpeg-builder.ts')
-rw-r--r-- | server/lib/transcoding/shared/ffmpeg-builder.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/lib/transcoding/shared/ffmpeg-builder.ts b/server/lib/transcoding/shared/ffmpeg-builder.ts new file mode 100644 index 000000000..441445ec4 --- /dev/null +++ b/server/lib/transcoding/shared/ffmpeg-builder.ts | |||
@@ -0,0 +1,18 @@ | |||
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 | } | ||