From 0c65d6eee509dad127c687f622b4eb536c519867 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Fri, 14 Feb 2020 12:13:50 +0800 Subject: [PATCH] extract also raw data streams --- src/ffmpeg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ffmpeg.js b/src/ffmpeg.js index 07f70dac..5fb8c795 100644 --- a/src/ffmpeg.js +++ b/src/ffmpeg.js @@ -334,6 +334,7 @@ function mapCodecToOutputFormat(codec, type) { if (type === 'video') return { ext: 'mkv', format: 'matroska' }; if (type === 'audio') return { ext: 'mka', format: 'matroska' }; if (type === 'subtitle') return { ext: 'mks', format: 'matroska' }; + if (type === 'data') return { ext: 'bin', format: 'data' }; // https://superuser.com/questions/1243257/save-data-stream return undefined; } @@ -344,7 +345,7 @@ async function extractAllStreams({ customOutDir, filePath }) { const outStreams = streams.map((s, i) => ({ i, - codec: s.codec_name, + codec: s.codec_name || s.codec_tag_string || s.codec_type, type: s.codec_type, format: mapCodecToOutputFormat(s.codec_name, s.codec_type), }))