Fix audio file merge
Image streams are considered as video streams by ffmpeg Filter out image codec name
This commit is contained in:
parent
ba24a31c26
commit
f686f5ed0a
2 changed files with 11 additions and 2 deletions
|
@ -26,7 +26,7 @@ describe('Test stats (excluding redundancy)', function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(60000)
|
this.timeout(120000)
|
||||||
|
|
||||||
servers = await createMultipleServers(3)
|
servers = await createMultipleServers(3)
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,19 @@ function ffprobePromise (path: string) {
|
||||||
// Audio
|
// 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) {
|
async function isAudioFile (path: string, existingProbe?: FfprobeData) {
|
||||||
const videoStream = await getVideoStream(path, existingProbe)
|
const videoStream = await getVideoStream(path, existingProbe)
|
||||||
|
if (!videoStream) return true
|
||||||
|
|
||||||
return !videoStream
|
if (imageCodecs.has(videoStream.codec_name)) return true
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
async function hasAudioStream (path: string, existingProbe?: FfprobeData) {
|
async function hasAudioStream (path: string, existingProbe?: FfprobeData) {
|
||||||
|
|
Loading…
Reference in a new issue