2023-04-21 14:55:10 +02:00
|
|
|
import { FfprobeData } from 'fluent-ffmpeg'
|
|
|
|
import { CONFIG } from '@server/initializers/config'
|
2023-05-05 10:53:04 +02:00
|
|
|
import { canDoQuickAudioTranscode, canDoQuickVideoTranscode, ffprobePromise } from '@shared/ffmpeg'
|
2023-04-21 14:55:10 +02:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|