From 00fd0482a5896d6b0c87a45d8c8ee11d446ff178 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Thu, 3 Sep 2015 18:11:25 -0700 Subject: [PATCH] ffmpeg: fix issue where valid streams are overridden by invalid ones --- lib/ffmpeg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ffmpeg.js b/lib/ffmpeg.js index 9a090cf0..e27d6418 100644 --- a/lib/ffmpeg.js +++ b/lib/ffmpeg.js @@ -128,7 +128,8 @@ function reformatData(data) { var container = data.format.format_name.split(",")[0]; data.streams.forEach(function (stream) { - if (stream.codec_type === "video") { + if (stream.codec_type === "video" && + acceptedCodecs.hasOwnProperty(container + "/" + stream.codec_name)) { reformatted.vcodec = stream.codec_name; if (!reformatted.title && stream.tags) { reformatted.title = stream.tags.title;