Fix rotation detection for HDR videos #50854
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Fixes #50853
Detail
The video analyzer was relying on the positional reference of side_data to fetch the rotation metadata. However, the side_data is not guaranteed to be in the same position for all videos. For instance, HDR videos shot on iOS in portrait mode have "DOVI configuration record" side_data in the first position, followed by the "Display matrix" side data containing the rotation value.
This fix removes the positional reference and explicitely searches for the "Display Matrix" side_data to retrieve the rotation angle.
Additional information
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]