Closed lgaribaldi closed 10 months ago
Looks good. Thanks for the fix, just add some parentheses for operator precedence and I'll merge. I understand that the expression will evaluate correctly, I just find the intent more clear with the parentheses.
if rotation, ok := data["tag:rotate"]; ok && (rotation == "90" || rotation == "270") {
video.width, video.height = video.height, video.width
}
When a video has a "rotate" tag in metadata, the video player rotates when playing the video, giving it a portrait perspective. Because of this, the width is still larger than height even in a portrait video. Which causes the stride to be off and the resulting frame to be scrambled. This can be fixed by inverting the width and height of the video when there is a rotation.
Related to #10