diff options
Diffstat (limited to 'shared/extra-utils/ffprobe.ts')
-rw-r--r-- | shared/extra-utils/ffprobe.ts | 7 |
1 files changed, 7 insertions, 0 deletions
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) { | |||
17 | }) | 17 | }) |
18 | } | 18 | } |
19 | 19 | ||
20 | async function isAudioFile (path: string, existingProbe?: FfprobeData) { | ||
21 | const videoStream = await getVideoStreamFromFile(path, existingProbe) | ||
22 | |||
23 | return !videoStream | ||
24 | } | ||
25 | |||
20 | async function getAudioStream (videoPath: string, existingProbe?: FfprobeData) { | 26 | async function getAudioStream (videoPath: string, existingProbe?: FfprobeData) { |
21 | // without position, ffprobe considers the last input only | 27 | // without position, ffprobe considers the last input only |
22 | // we make it consider the first input only | 28 | // we make it consider the first input only |
@@ -174,6 +180,7 @@ export { | |||
174 | getDurationFromVideoFile, | 180 | getDurationFromVideoFile, |
175 | getAudioStream, | 181 | getAudioStream, |
176 | getVideoFileFPS, | 182 | getVideoFileFPS, |
183 | isAudioFile, | ||
177 | ffprobePromise, | 184 | ffprobePromise, |
178 | getVideoFileBitrate, | 185 | getVideoFileBitrate, |
179 | canDoQuickAudioTranscode | 186 | canDoQuickAudioTranscode |