transcoding-quick-transcode.ts 552 B

123456789101112
  1. import { FfprobeData } from 'fluent-ffmpeg'
  2. import { CONFIG } from '@server/initializers/config.js'
  3. import { canDoQuickAudioTranscode, canDoQuickVideoTranscode, ffprobePromise } from '@peertube/peertube-ffmpeg'
  4. export async function canDoQuickTranscode (path: string, existingProbe?: FfprobeData): Promise<boolean> {
  5. if (CONFIG.TRANSCODING.PROFILE !== 'default') return false
  6. const probe = existingProbe || await ffprobePromise(path)
  7. return await canDoQuickVideoTranscode(path, probe) &&
  8. await canDoQuickAudioTranscode(path, probe)
  9. }