PeerTube/server/core/lib/transcoding/transcoding-quick-transcode.ts

13 lines
576 B
TypeScript
Raw Normal View History

import { FfprobeData } from 'fluent-ffmpeg'
import { CONFIG } from '@server/initializers/config.js'
import { canDoQuickAudioTranscode, canDoQuickVideoTranscode, ffprobePromise } from '@peertube/peertube-ffmpeg'
2024-08-12 16:17:11 +02:00
export async function canDoQuickTranscode (path: string, maxFPS: number, existingProbe?: FfprobeData): Promise<boolean> {
if (CONFIG.TRANSCODING.PROFILE !== 'default') return false
const probe = existingProbe || await ffprobePromise(path)
2024-08-12 16:17:11 +02:00
return await canDoQuickVideoTranscode(path, maxFPS, probe) &&
await canDoQuickAudioTranscode(path, probe)
}