From 7fe38f79a63b78ca8581098de386cda3650e4bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Scha=CC=88rmeli?= Date: Sun, 11 Mar 2012 22:07:50 +0100 Subject: [PATCH] added fallback regex for title fetching --- lib/metadata.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/metadata.js b/lib/metadata.js index a7bc5454..375a98f6 100644 --- a/lib/metadata.js +++ b/lib/metadata.js @@ -32,7 +32,6 @@ var meta = module.exports = { var rotate = /rotate[\s]+:[\s]([\d]{2,3})/.exec(stderr); // get ffmpeg version - console.log(stderr); var getVersion = /ffmpeg version (?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)/i.exec(stderr); var ffmpegVersion = 0; if (getVersion) { @@ -72,6 +71,14 @@ var meta = module.exports = { } }; + // fallback logic for title (ffmpeg version madness) + if (ret.titlr == null) { + var title_fallback = /INAM\s+\:(.+)/exec(stderr); + if (title_fallback && title_fallback.length > 1) { + ret.title = title_fallback[1]; + } + } + // calculate duration in seconds if (duration && duration.length > 1) { var parts = duration[1].split(':');