From 2f09a42f404d8f38c9ac25732066caac8a79e6f9 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Fri, 24 Apr 2020 14:10:13 +0800 Subject: [PATCH] add rotation to file info --- util.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util.js b/util.js index 1f5edb3..2dd746d 100644 --- a/util.js +++ b/util.js @@ -16,12 +16,15 @@ async function readFileInfo(p) { ]); const json = JSON.parse(stdout); const stream = json.streams[0]; + + const rotation = stream.tags && stream.tags.rotate && parseInt(stream.tags.rotate, 10); return { // numFrames: parseInt(stream.nb_frames, 10), duration: parseFloat(stream.duration, 10), width: stream.width, // TODO coded_width? height: stream.height, framerateStr: stream.r_frame_rate, + rotation: !Number.isNaN(rotation) ? rotation : undefined, }; }