Skip to content

Commit b3625f6

Browse files
committed
rotation can be not only the first element of side_data_list
1 parent c77c302 commit b3625f6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

util.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ export async function readVideoFileInfo(ffprobePath, p) {
3737
let rotation = parseInt(stream.tags && stream.tags.rotate, 10);
3838

3939
// If we can't find rotation, try side_data_list
40-
if (Number.isNaN(rotation) && Array.isArray(stream.side_data_list) && stream.side_data_list[0] && stream.side_data_list[0].rotation) {
41-
rotation = parseInt(stream.side_data_list[0].rotation, 10);
40+
if (Number.isNaN(rotation) && Array.isArray(stream.side_data_list)) {
41+
stream.side_data_list.forEach(element => {
42+
if (element.rotation) {
43+
rotation = parseInt(element.rotation, 10);
44+
}
45+
});
4246
}
4347

4448
return {

0 commit comments

Comments
 (0)