diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-23 10:57:55 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-23 10:57:55 +0100 |
commit | 482b26231b4e39234f107b8400ef606c5f003c55 (patch) | |
tree | 1a50f292b77b9b297f0885867da9f20c02582706 /shared/extra-utils | |
parent | c7c6afc66d7611d4c02572d63801beca26c45204 (diff) | |
download | PeerTube-482b26231b4e39234f107b8400ef606c5f003c55.tar.gz PeerTube-482b26231b4e39234f107b8400ef606c5f003c55.tar.zst PeerTube-482b26231b4e39234f107b8400ef606c5f003c55.zip |
Fix audio only transcoding
Diffstat (limited to 'shared/extra-utils')
-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 |