aboutsummaryrefslogtreecommitdiffhomepage
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
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
-rw-r--r--server/tests/api/server/stats.ts2
-rw-r--r--shared/extra-utils/ffprobe.ts11
2 files changed, 11 insertions, 2 deletions
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts
index 6654eaaee..bc35cbe4e 100644
--- a/server/tests/api/server/stats.ts
+++ b/server/tests/api/server/stats.ts
@@ -26,7 +26,7 @@ describe('Test stats (excluding redundancy)', function () {
26 } 26 }
27 27
28 before(async function () { 28 before(async function () {
29 this.timeout(60000) 29 this.timeout(120000)
30 30
31 servers = await createMultipleServers(3) 31 servers = await createMultipleServers(3)
32 32
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) {