diff --git a/lib/metadata.js b/lib/metadata.js index 6014bac5..5e97c08c 100644 --- a/lib/metadata.js +++ b/lib/metadata.js @@ -18,7 +18,7 @@ var meta = module.exports = { var video_bitrate = /bitrate: ([0-9]+) kb\/s/.exec(stderr); var fps = /([0-9\.]+) (fps|tb\(r\))/.exec(stderr); var container = /Input #0, ([a-zA-Z0-9]+),/.exec(stderr); - var title = /title *: ([^\n]+)/.exec(stderr); + var title = /(INAM|title)\s+:(.+)/.exec(stderr); var video_stream = /Stream #([0-9\.]+)([a-z0-9\(\)\[\]]*)[:] Video/.exec(stderr); var video_codec = /Video: ([\w]+)/.exec(stderr); var duration = /Duration: (([0-9]+):([0-9]{2}):([0-9]{2}).([0-9]+))/.exec(stderr); @@ -49,7 +49,7 @@ var meta = module.exports = { var ret = { ffmpegversion: ffmpegVersion, durationraw: (duration && duration.length > 1) ? duration[1] : '', - title: (title && title.length > 1) ? title[1] : null, + title: (title && title.length > 2) ? title[2].trim() : null, synched: is_synched, video: { container: (container && container.length > 0) ? container[1] : '', @@ -71,14 +71,6 @@ var meta = module.exports = { } }; - // fallback logic for title (ffmpeg version madness) - if (ret.title == 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(':');