From 482b26231b4e39234f107b8400ef606c5f003c55 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 23 Dec 2021 10:57:55 +0100 Subject: Fix audio only transcoding --- shared/extra-utils/ffprobe.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'shared/extra-utils/ffprobe.ts') diff --git a/shared/extra-utils/ffprobe.ts b/shared/extra-utils/ffprobe.ts index 9257bbd5f..53a3aa001 100644 --- a/shared/extra-utils/ffprobe.ts +++ b/shared/extra-utils/ffprobe.ts @@ -17,6 +17,12 @@ function ffprobePromise (path: string) { }) } +async function isAudioFile (path: string, existingProbe?: FfprobeData) { + const videoStream = await getVideoStreamFromFile(path, existingProbe) + + return !videoStream +} + async function getAudioStream (videoPath: string, existingProbe?: FfprobeData) { // without position, ffprobe considers the last input only // we make it consider the first input only @@ -174,6 +180,7 @@ export { getDurationFromVideoFile, getAudioStream, getVideoFileFPS, + isAudioFile, ffprobePromise, getVideoFileBitrate, canDoQuickAudioTranscode -- cgit v1.2.3