-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
aspect ratio issues investigations #258
Comments
In java world one could use the MediaCodec https://developer.android.com/reference/android/media/MediaCodec#setVideoScalingMode(int) |
In Ndk domain, |
Relevant part in avos is |
Java's setVideoScalingMode calls:
This means that the information is transmitted to both hwcomposer and codec. So we can try to use AMediaCodec_setParameters to set "android._video-scaling"'s value to the mode we want |
Regarding more strange AR issues as reported here #257 one need to check that codec report is correct (should be enforced by CTS) and this can be done monitoring
|
On another track, Philips TVs (MTK based) are showing also AR issues after upgrading to Android 9 but this is not happening on Sony TVs (MTK based too). |
|
Cf. https://gist.github.com/courville/f64cb4cd6e6f644c52042de2ca5f1b6a |
We need someone to test on Philips/MTK and the weird rk3328 aspect-ratio
issue too
Le jeu. 12 déc. 2019 à 11:13, Marc de Courville <[email protected]>
a écrit :
… Cf. https://gist.github.com/courville/f64cb4cd6e6f644c52042de2ca5f1b6a
Asking the codec to do the scale to fit with crop seems to make amlogic
mibox s working.
Need to check on miproj.
Issue with the above approach is that it requires API26 because
AMediaCodec_setParameters is not available on former versions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#258?email_source=notifications&email_token=AAAA4OVYPEAZY7AKZQEQUF3QYIFC7A5CNFSM4JY5ONH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGWE7WI#issuecomment-564940761>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAA4OQCMDMGS3PTRBYMEULQYIFC7ANCNFSM4JY5ONHQ>
.
|
Already done: https://www.reddit.com/r/NovaVideoPlayer/comments/dz4wh5/reqissue_android_tv_9_pie_aspect_ratio_totally/ test results soon for Philips. |
Feedback from testers: no effect on miproj, philips tv, rk box. |
New approach: https://gist.github.com/courville/2fe4056f2846319f69368f80fc63c2be and test apk shared. |
OK I found a firestick4k and aspect ratio is corrected with the proposed fix regarding the video provided here #259
|
Some grep command to parse the logcat: |
On Philips TV nothing strange is seen:
|
Full philips TV logs. |
…the display. One can think that this is an horridious option that should never have been introduced because it breaks the golden rule of preserving the aspect ratio. However this is the only way to get a correct aspect ratio on recent Android 9+ Philips Android TV. Philips TV seems to do something fundamentally wrong using MediaCodec which is to add black horizontal bars resulting in compressed vertically video image. This stretched mode should restore a good aspect ratio for 1920x800 21:9 movies. See nova-video-player/aos-AVP#258
I will add a stretched option in the next release since it solves the wrong aspect ratio on Philips 65PUS7304 (2019 model), Philips has really made a bad implementation. |
I figured out what the issue was that was plaguing many apps on newer Philips TVs. Philips Android 9 MediaCodec implementation requires that on MediaFormat used to configure the codec you set not only the KEY_WIDTH and KEY_HEIGHT but also the KEY_MAX_WIDTH and KEY_MAX_HEIGHT parameters. This has already been tested on a Kodi build and works as expected. |
@primozcerar thanks for the tip. According to other references it could also fix the issue on amlogic not getting fullscreen for 4:3 video. I will investigate and it might help me remove the stretch mode. |
See xbmc/xbmc#17353 |
Possibly fixes the inability to tune aspect ratio on latest amlogic Android 9 versions. Thanks @primozcerar for the tip. See nova-video-player/aos-AVP#258
I noticed in xbmc that the change for KEY_MAX_WIDTH has been reverted. Are you aware of any reason for this or another way to fix the AR for philips TVs? See xbmc/xbmc#17557 referencing xbmc/xbmc#17534 And the severe issues and regressions on sony and philips are described there xbmc/xbmc#17559 |
This reverts commit 72156d4. Apparently it causes many regressions on sony and philips tvs... See nova-video-player/aos-AVP#258
… to the size of the display."" This reverts commit a3edbc5. afterall this is needed see nova-video-player/aos-AVP#258
This reverts commit 72c4790. afterall this is needed see nova-video-player/aos-AVP#258
I am not. Sorry.
V V pet., 12. jun. 2020 ob 19:09 je oseba CourvilleSoftware <
[email protected]> napisala:
… @primozcerar <https://github.com/primozcerar> I noticed in xbmc that the
change for KEY_MAX_WIDTH has been reverted. Are you aware of any reason for
this or another way to fix the AR for philips TVs?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#258 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABU4RNVHPWW2LQVWYITW7VTRWJONNANCNFSM4JY5ONHQ>
.
|
Closing due to inactivity and possibly prior solving. Please reopen an issue if needed. |
@courville I have an issue on Google TV. When I try to set the
If I switch to the software decoder, it all works ok. Should I stay on the software decoder? |
@andrei-tatar What's your device? |
@phhusson I'm using a Google TV or Google Chromecast TV. Not sure exactly what it's called. It's the one with a small remote. |
k so FYI the official name of this device is "Chromecast with Google TV" (I prefer calling it "sabrina" since the name is a non-sense). @courville will test this on his own |
@andrei-tatar ok I confirm the issue and it seems to be a regression. Will have a look at it. |
@andrei-tatar quick question for you: can you please provide the video resolution of your sample and check that the video itself does not contain black top and bottom bars that would prevent the video scaling since the video aspect ratio would match the one of the screen of the TV? In this case this would not be a bug... |
Sure, I can check in a few hours. But I already confirmed the software decoder works as expected. It seems to be an issue with the hardware decoder. |
@andrei-tatar you are right. Issue not reproduced on nvidia shield and emulator but present on all amlogic based hardware (miprod + googletv=sabrina) and only present when hwdec enabled. @phhusson do you reproduce on freePlayerPop? EDIT: works on pop. Thus probably amlogic SDK bug. |
Indeed, I have a brand new Onn 4K box which has an Amlogic S905Y2 (it's an amazing value since the major bugs got fixed, btw) and I see the exact same thing as @andrei-tatar on this device when playing https://www.youtube.com/watch?v=UmBAhFSROLo which I downloaded as 1920x800 using yt-dlp. When I switch to software decoding, fullscreen and stretched look different, while original and optimized look the same. This is interesting since the Onn 4K is just a re-brand of the ADT-3 developer box that came out in 2020. so along with the Sabrina device, that's 2 devices that Google devs can be contacted about to see if they can help with getting Amlogic to provide a fix. |
On Philips TV (mtk) it has been reported that AR is wrong https://www.reddit.com/r/NovaVideoPlayer/comments/dz4wh5/reqissue_android_tv_9_pie_aspect_ratio_totally/
On amlogic when selecting full screen AR is wrong with 21:9 and 4:3 videos that are stretched instead of applying a zoom.
It appears when surface has been scaled and exceeds screen dimension i.e. codec does a scale instead of crop.
@phhusson hinted towards https://github.com/xbmc/xbmc/blob/master/tools/android/packaging/xbmc/src/XBMCVideoView.java.in#L117
@phhusson also suggested that a
echo 6 > /sys/class/video/screen_mode
could help on amlogic cf. https://gist.github.com/phhusson/b36755226e06f313caca41ec573b8e93 i.e.:The text was updated successfully, but these errors were encountered: