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 {