aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/transcoding/transcoding-quick-transcode.ts
blob: 53f12cd06fa23e34e1a8432062ea2d127ccf58cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { FfprobeData } from 'fluent-ffmpeg'
import { CONFIG } from '@server/initializers/config'
import { canDoQuickAudioTranscode, canDoQuickVideoTranscode, ffprobePromise } from '@shared/ffmpeg'

export async function canDoQuickTranscode (path: string, existingProbe?: FfprobeData): Promise<boolean> {
  if (CONFIG.TRANSCODING.PROFILE !== 'default') return false

  const probe = existingProbe || await ffprobePromise(path)

  return await canDoQuickVideoTranscode(path, probe) &&
         await canDoQuickAudioTranscode(path, probe)
}