Android TV (Sony x900f 4k TV) and cropped 4k media

Server Version#: 1.19.5.3112
Player Version#: 8.4.2.19372

I have a synology ds920+ which i setup with a plex server and im using directPlay to playback content on my Sony x900f 4k Android TV.

I use direct play to playback my 4k videos, which are h264, ≈60mbps bitrate and 8bit, 30 fps.

When I play them using displayMode ‘Original’ (not letterbox), only a quarter of the video is rendered.

After my analysis of the logs, seems to be a problem with how ExoPlayer picks up my TV’s screen size/resolution.

I pulled the plex app logs: log.txt (32.4 KB)

I reviewd the logs and some parts caught my eye:

First, it seems my 4k TV is listed with screen size 1920x1080, when it should be 4k:

08-06 15:24:35.785 i: Manufacturer: Sony Device: BRAVIA_ATV3_4K Model: BRAVIA 4K GB ATV3 Product: BRAVIA_ATV3_4K_UC Version: 8.0.0
08-06 15:24:35.788 i: Screen size: Large Screen density: XHigh Resolution: 1920x1080 DPI: 320 Touchscreen: false Marketplace: com.android.vending Architecture: armeabi-v7a

Then i see some ‘DisplayBehavior’ entries where i see its trying to figure out what resolution to use for my 4k video, and it decides to use 1920x1080 instead of 3840x2160:

08-06 15:24:50.463 i: [DisplayBehaviour] Activity has been changed, searching for available modes.
08-06 15:24:50.477 i: [DisplayBehaviour] Current mode detected as 1920x1080 @ 60.0000Hz (1).

08-06 15:24:50.724 i: [DisplayBehaviour] Mode found: 1920x1080 @ 60.0000Hz (1) (Score: 49.94 (RR: 49.94 R: 0.00)
08-06 15:24:50.725 i: [DisplayBehaviour] Best mode for 3840x2160 @ 29.969999Hz selected as 1920x1080 @ 60.0000Hz (1).
08-06 15:24:50.727 i: [DisplayBehaviour] Mode is already set to our best mode of 1920x1080 @ 60.0000Hz (1).

What ends up happening is that the video renders all cropped, since its trying to play 4k content on a 1920x1080 resolution without downscaling.

If i change the ‘display mode’ playback setting to ‘Letterbox’, the app now downscales my 4k video to 1080p, but that introduces buffering and also i really want to playback @ 4k and not 1080p.

just as FYI for what is worth, if i stream the same 4k videos outside of plex through SMB with Kodi or VLC, those stream and playback to the correct resolution.

Any assistance is appreciated, and if additional information or plex server side logs are needed just let me know.

Thank you!

You already have another post about this so not sure why you are making a new one. I am going to close the other one. Sony x900f Android TV and 4k content

Does your TV have display mode or resolution switching? is that enabled in the app?

1 Like

I realized it was in the wrong category (smart tvs) after reading the category list. I flagged my previous post to get it deleted and started this one on the right category under “streaming devices”.

I tried enabling both resolution switching and refresh rate siwtching on the plex app to see if it would allow me to force the plex app to use 4k resolution but I didnt see any option to actually do that.

I tried also looking at my TV’s picture/video settings to see if i could also change the display mode there but theres no an option for that, it seems like its all built in.

possibly some info here. seems to be some Enhanced mode that needs to be enabled on TV but not sure. https://www.sony.com/electronics/support/articles/00167189

1 Like

looking into this, and from what it seems, i can only set the range when theres a device connected with hdmi to the TV. in this case the plex app is installed directly on the TV, since it has android, and not through a separete device like ps4 or roku.

Theres doesnt seem to be any settings to control the range when running apps directly installed on the TV, the setting is actually disabled.

why are your 4k videos 264, when they are normally hevc/265 10bit ?

perhaps your tv simply does not support 4k on 264 SDR.

have you tried any hevc/265 4k HDR videos ?

1 Like

Went ahead and downloaded some jellyfish test files to see if h265/10bit would do any difference.

Same results, content is identified as 4k and on my PMS i see direct play (no transcoding), but on my TV the video is cropped if using display mode Original, and downscaled if using Letterbox.

Here’s before playing:

Here’s while playing, you can see the 4k tag and video looks cropped/zoomed in:

Here you can see where its display mode set as Original where the video gets cropped (its as it is was zoomed since its showing 4k video on 1920x1080 resolution):

And finally here when i switch to Letterbox, you can see the video now shows the whole frame, but its being downscaled to 1080p:

And here are the logs.

This is the log when using letterbox: log-letterbox.txt (27.3 KB) There’s a line that says:

08-06 17:42:41.362 i: [Player][DimensionsLayout] Resizing: 1920 x 1080

which i interpret as downscaling my 4k video to 1080p.

And this is a log when using Original: log-original.txt (27.6 KB) Here the line says instead:

08-06 17:47:10.750 i: [Player][DimensionsLayout] Resizing: 3840 x 2160

which i interpret as rendering the video on 4k, but since my resolution is 1080p, the video ends up looking cropped.

1 Like

Reading about Sony 4k TV’s, looks like the way these Sony 4k TVs work is that they report 1080p for apps and their UI, but for video playback they report and do allow 4k, so there’s some nuances on how the OS works in these TVs. (Sony 4K Bravia TV reports 1080p resolution to apps - Page 3 - Sony) but this seems to be completely normal and handled correctly by many apps.

Also, found some git issues where the same issue has been found on google’s ExoPlayer:

Based on the conversation on these git issues, the issue seems to be around which surface is used to playback the video. The solution offered there seems to be around using SurfaceView to correctly playback the video @ 4k while the app UI is only 1080p.

Looking at ExoPlayer v2 logs, it seems that instead of SurfaceView, it uses MediaCodec surface, is this surface not reacting correctly to sony 4k TVs circumstances of having the app UI running @ 1080p while videos should be at 4k? Or is there some other thing preventing MediaCodec surface from showing the full video correctly on my TV, maybe some other bug?

Maybe if the Player view was not limited to 1920x1080, it would let the MediaCodec surface resize correctly?

08-06 17:47:09.042 i: [Player][View] Layout has been measured with a size of 1920 x 1080 (1920 x 1080).

Is the code for Plex’s ExoPlayer V2 open source?

You’ve found the joys of Android TV, this happens for all Android TV devices and not just Sony. The UI is always 1080p and then the OS rescales it up or down automatically, but video playback can happen natively at the TV’s full resolution! This makes the logs very confusing and in some cases the resolutions indicated in the logs don’t make much sense.

The surface indicated in the logs is the right one, it’s a SurfaceView under the hood despite being called the MediaCodec Surface in the logs as we also have another surface which is used for software decoded playback (MediaCodec is mostly hardware based).

Is the code for Plex’s ExoPlayer V2 open source?

Our version of ExoPlayer is closed source due to the nature of our modifications, however our modifications are fairly minor in comparison (they mostly allow us to do better software decoding and demuxing of containers like AVI).

I’m having trouble understanding your problem, as it seems like everything is working correctly. When you use Orginal Display Mode for a 4K video and your TV is only 1080p then the video will be cropped down as its impossible to keep the original resolution and fully display it on your TV. I might be wrong but looking at the log files included and your TV is set to use a resolution of 1080p and not 4K. This should be a display setting inside of the OS settings that you should be able to modify and enable 4K mode.

The thing is this TV doesn’t let me adjust the resolution. It’s like you confirmed, the TV runs locked at 1080p for Android TV and its apps for all the UIs, so my TV resolution is in fact 1920x1080 for the OS just like you see in the logs. There is no setting to change the resolution, since by design they want the TV to run AndroidTV and apps at 1080p.

Reading about the subject, looks like this shouldn’t lock video playback to 1080p though, there’s information about how while the TV reports 1080p for AndroidTV and apps UI, it should still be doable to video playback at 4k, I’ve experimented with other apps on my TV and can confirm other video apps do playback at 4k, so there must be some code magic that is needed for this to happen.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.