From ce5ddf11b202783c9e4ad40b6fd5e862ab4e710e Mon Sep 17 00:00:00 2001 From: pandominox Date: Fri, 8 Oct 2021 14:31:37 +0200 Subject: [PATCH] Add array of "frames" for ffprobe option "-show_frames" Add array of "frames" in returned data in case of call ffprobe() with option "-show_frames", containing all set of information about video/audio frames. Current call of ffprobe() allows adding "-show_frames" option, but returned data doesn't contain this information, because of lack this property (as array of 'frames') in 'data' variable and not parsing 'frame' blocks in data returned in 'stdout' from ffprobe command. --- lib/ffprobe.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ffprobe.js b/lib/ffprobe.js index d24be85d..5341541e 100644 --- a/lib/ffprobe.js +++ b/lib/ffprobe.js @@ -15,6 +15,7 @@ function parseFfprobeOutput(out) { }); var data = { + frames: [], streams: [], format: {}, chapters: [] @@ -57,8 +58,11 @@ function parseFfprobeOutput(out) { data.chapters.push(chapter); } else if (line.toLowerCase() === '[format]') { data.format = parseBlock('format'); + } else if (line.match(/^\[frame/i)) { + var frame = parseBlock('frame'); + data.frames.push(frame); } - + line = lines.shift(); }