]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/ffprobe.ts
Translated using Weblate (German)
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / ffprobe.ts
index dfacd251c6f84df5e60c87297603ae56bee06354..b95202464f105c7af4236a17364ad894d0cdf901 100644 (file)
@@ -21,10 +21,19 @@ function ffprobePromise (path: string) {
 // Audio
 // ---------------------------------------------------------------------------
 
+const imageCodecs = new Set([
+  'ansi', 'apng', 'bintext', 'bmp', 'brender_pix', 'dpx', 'exr', 'fits', 'gem', 'gif', 'jpeg2000', 'jpgls', 'mjpeg', 'mjpegb', 'msp2',
+  'pam', 'pbm', 'pcx', 'pfm', 'pgm', 'pgmyuv', 'pgx', 'photocd', 'pictor', 'png', 'ppm', 'psd', 'sgi', 'sunrast', 'svg', 'targa', 'tiff',
+  'txd', 'webp', 'xbin', 'xbm', 'xface', 'xpm', 'xwd'
+])
+
 async function isAudioFile (path: string, existingProbe?: FfprobeData) {
   const videoStream = await getVideoStream(path, existingProbe)
+  if (!videoStream) return true
+
+  if (imageCodecs.has(videoStream.codec_name)) return true
 
-  return !videoStream
+  return false
 }
 
 async function hasAudioStream (path: string, existingProbe?: FfprobeData) {