You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support reflective video transformations during ExoPlayer playback (e.g. from QuickTime/iOS MP4 files) #2012
Replace its original uri with below: "https://zh-files.oss-cn-qingdao.aliyuncs.com/20170808223928mJ1P3n57.mp4","https://wx-love-img.afunapp.com/ec34db03f040ee1cfb9cfef5c087aaf3"
In fact, the two urls above are all rotated -90 degree
Expected result
And the weird thing is, for "https://zh-files.oss-cn-qingdao.aliyuncs.com/20170808223928mJ1P3n57.mp4",the video frame is OK
for "https://wx-love-img.afunapp.com/ec34db03f040ee1cfb9cfef5c087aaf3", the video frame is not OK, it rotates -90 degree. It should like this:
Actual result
for "https://wx-love-img.afunapp.com/ec34db03f040ee1cfb9cfef5c087aaf3" , the video frame rotate -90 degree, like this
Media
The reproducible url:"https://wx-love-img.afunapp.com/ec34db03f040ee1cfb9cfef5c087aaf3"
Bug Report
You will email the zip file produced by adb bugreport to [email protected] after filing this issue.
Thank you for your patience. I investigated the media in question and found that its transformation matrix is not purely rotational, it also involves flipping. Our current implementation assumes that the transformation matrix only represents rotation, which is why it doesn’t handle this case correctly.
Tools like ffmpeg, mediainfo, or even media players like VLC use a mathematical formula to calculate rotation based on the assumption that the transformation matrix is purely rotational. In this case, that assumption doesn’t hold, leading to incorrect rotation values and ultimately displaying the wrong output since the video should also be flipped.
I’ll mark this issue as a feature request to add support for flipping using the transformation matrix. Thanks for reporting this!
Here’s a comparison of VLC (incorrect) vs. QuickTime (correct):
The commit linked above makes ExoPlayer behave like VLC - so these videos are now the right way up, but still incorrectly mirrored in the y-axis. Resolving the mirroring issue is a bit more complicated. I will re-title this issue to reflect that's what it's tracking.
changed the title [-]Video frame rotates -90 degree[/-][+]Support reflective video transformations during ExoPlayer playback (e.g. from QuickTime/iOS MP4 files)[/+]on Jun 16, 2025
Activity
claincly commentedon Jan 3, 2025
@rohitjoins I feel this could be related to extractors not parsing the correct rotation? Could you take a look?
hust-twj commentedon Jan 6, 2025
@claincly @rohitjoins Thanks in advance.
rohitjoins commentedon Jan 16, 2025
Hi @hust-twj,
Thank you for your patience. I investigated the media in question and found that its transformation matrix is not purely rotational, it also involves flipping. Our current implementation assumes that the transformation matrix only represents rotation, which is why it doesn’t handle this case correctly.
Tools like
ffmpeg,mediainfo, or even media players likeVLCuse a mathematical formula to calculate rotation based on the assumption that the transformation matrix is purely rotational. In this case, that assumption doesn’t hold, leading to incorrect rotation values and ultimately displaying the wrong output since the video should also be flipped.I’ll mark this issue as a feature request to add support for flipping using the transformation matrix. Thanks for reporting this!
Here’s a comparison of VLC (incorrect) vs. QuickTime (correct):
Resolve rotation from rotate+reflect `tkhd` transform matrices
icbaker commentedon Jun 16, 2025
The commit linked above makes ExoPlayer behave like VLC - so these videos are now the right way up, but still incorrectly mirrored in the y-axis. Resolving the mirroring issue is a bit more complicated. I will re-title this issue to reflect that's what it's tracking.
[-]Video frame rotates -90 degree[/-][+]Support reflective video transformations during ExoPlayer playback (e.g. from QuickTime/iOS MP4 files)[/+]xxoo commentedon Jan 9, 2026
This webm is transformed with ffmpeg:
02.webm
It looks like this in chrome:
But ExoPlayer does not seem to respect the meta orientation:
Feat/migrate media3 1.8 (#43)