aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-12 16:00:15 +0200
committerChocobozzz <me@florianbigard.com>2022-07-12 16:00:15 +0200
commitf686f5ed0aca2c43d42779f9eb2dc1636b5bac6b (patch)
tree7f00ae8d6d6956fb6d0f17608f94387173716608 /shared/extra-utils
parentba24a31c26ff566ea419399c3a49bf9d170bc66b (diff)
downloadPeerTube-f686f5ed0aca2c43d42779f9eb2dc1636b5bac6b.tar.gz
PeerTube-f686f5ed0aca2c43d42779f9eb2dc1636b5bac6b.tar.zst
PeerTube-f686f5ed0aca2c43d42779f9eb2dc1636b5bac6b.zip
Fix audio file merge
Image streams are considered as video streams by ffmpeg Filter out image codec name
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/ffprobe.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/shared/extra-utils/ffprobe.ts b/shared/extra-utils/ffprobe.ts
index dfacd251c..b95202464 100644
--- a/shared/extra-utils/ffprobe.ts
+++ b/shared/extra-utils/ffprobe.ts
@@ -21,10 +21,19 @@ function ffprobePromise (path: string) {
21// Audio 21// Audio
22// --------------------------------------------------------------------------- 22// ---------------------------------------------------------------------------
23 23
24const imageCodecs = new Set([
25 'ansi', 'apng', 'bintext', 'bmp', 'brender_pix', 'dpx', 'exr', 'fits', 'gem', 'gif', 'jpeg2000', 'jpgls', 'mjpeg', 'mjpegb', 'msp2',
26 'pam', 'pbm', 'pcx', 'pfm', 'pgm', 'pgmyuv', 'pgx', 'photocd', 'pictor', 'png', 'ppm', 'psd', 'sgi', 'sunrast', 'svg', 'targa', 'tiff',
27 'txd', 'webp', 'xbin', 'xbm', 'xface', 'xpm', 'xwd'
28])
29
24async function isAudioFile (path: string, existingProbe?: FfprobeData) { 30async function isAudioFile (path: string, existingProbe?: FfprobeData) {
25 const videoStream = await getVideoStream(path, existingProbe) 31 const videoStream = await getVideoStream(path, existingProbe)
32 if (!videoStream) return true
33
34 if (imageCodecs.has(videoStream.codec_name)) return true
26 35
27 return !videoStream 36 return false
28} 37}
29 38
30async function hasAudioStream (path: string, existingProbe?: FfprobeData) { 39async function hasAudioStream (path: string, existingProbe?: FfprobeData) {