Skip to content

[VideoDecoder] Frames are rotated when the video is in portrait mode / vertical-oriented #490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dbouidaine opened this issue May 9, 2022 · 1 comment

Comments

@dbouidaine
Copy link

I used the MP4Demuxer (as in the example here : webcodecs/samples/mp4-decoder, decoding videos in landscape mode works fine but when I decode a video in a portrait mode it gets rotated (from portrait -> landscape mode). So the video is not decoded as its original orientation and scale.

@sandersdan
Copy link
Contributor

Raw bitstreams do not carry orientation metadata, instead this detail is part of the media container.

Issue #351 is about defining properties that would enable you to pass this metadata through WebCodecs via VideoDecoderConfig. Until that is implemented, you'll need to plumb the metadata yourself.

In any case you'll need to be able to extract the orientation metadata from the container. My understanding is the mp4box.js does not offer any help here, it just puts the raw unparsed data in mvhd.matrix and tkhd.matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants