ffmpeg-builder.ts 674 B

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