From b3625f631178504bda4ceb70faee1792ce0ff71c Mon Sep 17 00:00:00 2001 From: SM Date: Tue, 4 Jul 2023 13:30:38 +0300 Subject: [PATCH] rotation can be not only the first element of side_data_list --- util.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/util.js b/util.js index ea72fb06..17062e0f 100644 --- a/util.js +++ b/util.js @@ -37,8 +37,12 @@ export async function readVideoFileInfo(ffprobePath, p) { let rotation = parseInt(stream.tags && stream.tags.rotate, 10); // If we can't find rotation, try side_data_list - if (Number.isNaN(rotation) && Array.isArray(stream.side_data_list) && stream.side_data_list[0] && stream.side_data_list[0].rotation) { - rotation = parseInt(stream.side_data_list[0].rotation, 10); + if (Number.isNaN(rotation) && Array.isArray(stream.side_data_list)) { + stream.side_data_list.forEach(element => { + if (element.rotation) { + rotation = parseInt(element.rotation, 10); + } + }); } return {