Skip to content

Commit

Permalink
rotation can be not only the first element of side_data_list
Browse files Browse the repository at this point in the history
  • Loading branch information
smka committed Jul 4, 2023
1 parent c77c302 commit b3625f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b3625f6

Please sign in to comment.