2023-04-21 14:55:10 +02:00
|
|
|
import { FfprobeData } from 'fluent-ffmpeg'
|
2023-07-31 14:34:36 +02:00
|
|
|
import { CONFIG } from '@server/initializers/config.js'
|
|
|
|
import { canDoQuickAudioTranscode, canDoQuickVideoTranscode, ffprobePromise } from '@peertube/peertube-ffmpeg'
|
2023-04-21 14:55:10 +02:00
|
|
|
|
2024-08-12 16:17:11 +02:00
|
|
|
export async function canDoQuickTranscode (path: string, maxFPS: number, existingProbe?: FfprobeData): Promise<boolean> {
|
2023-04-21 14:55:10 +02:00
|
|
|
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) &&
|
2023-04-21 14:55:10 +02:00
|
|
|
await canDoQuickAudioTranscode(path, probe)
|
|
|
|
}
|