4K Scale & Video Playback Issues

Hi,


We have been delivering 4K content for 3 years now on various devices and building out support for Apple TV 4K. We are running in to a few issues:


1) When calling [[UIScreen mainScreen] scale] this is returning 1.0 on an actual device. It properly returns 2.0 on the simulator. The [[UIScreen mainScreen] bounds].size returns 1920x1080 on both device and simulator. Thus, we were expectin the scale would be used to distinguish the device is 4K vs 1080p Apple TVs.


In Settings -> Video and Video we have:

Format - 4K HDR

Chroma 4:2:0


Screen appears fine and 4K video playback is working in the Netflix app.


The HDMI cable works fine for 4K playback on other non-Apple devices so should be fully compliant.


Thus, we are not able to properly detect the device.


2) 4K Video Streams will not play on device or simulator.

a) Attempted playing progressive MP4 HEVC streams (both 1080p and 4K). Audio plays but no video. Black screen. These play fine on other devices.

b) For adaptive bitrate, we've typically used MPEG-DASH HEVC. We understand this is not supported but when trying to use HLS streams, they won't play either. Details on m3u8 file (has 1080p, 4K, and audio only flavors):

https://SERVERPATH/a.m3u8

#EXTM3U

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1953792,RESOLUTION=1920x1080

https://SERVERPATH/index.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=8599552,RESOLUTION=3840x2160

https://SERVERPATH/index.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=56320,CODECS="mp4a.40.2"

https://SERVERPATH/index.m3u8


Example sub index.m3u8 file:

#EXTM3U

#EXT-X-TARGETDURATION:10

#EXT-X-ALLOW-CACHE:YES

#EXT-X-PLAYLIST-TYPE:VOD

#EXT-X-VERSION:6

#EXT-X-MEDIA-SEQUENCE:1

#EXT-X-MAP:URI="https://SERVERPATH/init-v1-a1.mp4"

#EXTINF:2.000,

https://SERVERPATH/seg-1-v1-a1.m4s

#EXTINF:2.000,

https://SERVERPATH/seg-2-v1-a1.m4s

#EXTINF:2.000,

https://SERVERPATH/seg-3-v1-a1.m4s

#EXTINF:4.000,

https://SERVERPATH/seg-4-v1-a1.m4s

#EXTINF:10.000,

https://SERVERPATH/seg-5-v1-a1.m4s

#EXTINF:10.000,

https://SERVERPATH/seg-6-v1-a1.m4s

#EXTINF:10.000,

https://SERVERPATH/seg-7-v1-a1.m4s

#EXTINF:10.000,

https://SERVERPATH/seg-8-v1-a1.m4s

#EXTINF:1.741,

https://SERVERPATH/seg-9-v1-a1.m4s

#EXT-X-ENDLIST


We would appreciate any feedback or pointing to documents on this. Anything related to 4K is hard to find at this time.


Thanks

James

Replies

Hi James, I assume that your view controller's view.contentScaleFactor (or the view's layer's contentsScale) are also set to 1? It sounds as though ToonGoggles is getting launched in `compatibility` mode. On iOS, configuring the app to use both a modern Main storyboard and LaunchScreen.storyboard are common techniques to get the app launched at the device's native resolution.

Re: "When calling [[UIScreen mainScreen] scale] this is returning 1.0 on an actual device":


[UILabel new].contentScaleFactor seems to be more reliable.