[tvOS] issues with setVideoAspectRatio via VLCKit

This forum is about all development around libVLC.
ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

[tvOS] issues with setVideoAspectRatio via VLCKit

Postby ssbmaccom » 11 Apr 2019 21:33

Hi,

a while ago I posted a bug report in VLCKit (https://code.videolan.org/videolan/VLCKit/issues/180).
During playback of a Live-TV stream that changes the VAR (Video Aspect Ratio) from 16:9 to 4:3 and back to 16:9, the switch to 4:3 is done (you get the black bars on the sides), but when the stream switches back to 16:9 the VAR shown does not change - it continues playback in 4:3.

Now I just wanted to add the option in my App to force playback to either 16:9 or 4:3 (some stations send their stream with wrong VAR info - a user of my App from China pointed me to that). So I used [mediaplayer setVideAspectRatio:"x:x"] of VLCKit to set the VAR to be used while playback.
There I found, that I can switch to "4:3", but then I can't switch back to "16:9" or NULL (auto) - the value is accepted, but the change does not have any effect.

I tried with todays nightly and debug log prompted me:

Code: Select all

:19:17:12:MoviePlayerViewContr:1325: aspect: (null) --> 4:3 2019-04-11 19:17:12.071741+0200 vuplusTV[458:43109] VoutDisplayEvent 'resize' 1440x1080 2019-04-11 19:17:12.072495+0200 vuplusTV[458:43007] VoutDisplayEvent 'resize' 1920x1080 2019-04-11 19:17:12.076691+0200 vuplusTV[458:43007] VoutDisplayEvent 'resize' 1920x1080 :19:17:17:MoviePlayerViewContr:1325: aspect: 4:3 --> (null) 2019-04-11 19:17:17.922541+0200 vuplusTV[458:43109] VoutDisplayEvent 'resize' 1920x1080 :19:17:28:MoviePlayerViewContr:1325: aspect: (null) --> (null) 2019-04-11 19:17:28.032507+0200 vuplusTV[458:43109] VoutDisplayEvent 'resize' 1920x1080 :19:17:33:MoviePlayerViewContr:1325: aspect: (null) --> 16:9 :19:17:35:MoviePlayerViewContr:1325: aspect: 16:9 --> 4:3 2019-04-11 19:17:35.313281+0200 vuplusTV[458:43109] VoutDisplayEvent 'resize' 1440x1080 2019-04-11 19:17:35.314459+0200 vuplusTV[458:43007] VoutDisplayEvent 'resize' 1920x1080 2019-04-11 19:17:35.315882+0200 vuplusTV[458:43007] VoutDisplayEvent 'resize' 1920x1080 :19:17:56:MoviePlayerViewContr:1325: aspect: 4:3 --> (null) 2019-04-11 19:17:56.353231+0200 vuplusTV[458:43109] VoutDisplayEvent 'resize' 1920x1080
In all cases the resize event arrives at the vout module, but when setting it to 4:3 it resizes display to 1440:1080 - shrinks it correctly - but then it resets the size automatically to 1920:1080 and therefore later events to set to 16:9 size are ignored, as the vout object "thinks" it is already using this size for playback.

Can you fix this issue and then make sure it gets adopted in VLCKit soon?

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: [tvOS] issues with setVideoAspectRatio via VLCKit

Postby unidan » 24 Apr 2019 15:41

Hi, sure, do you have a sample code/file to reproduce the issue ?

EDIT: couldn't reproduce with custom live stream with changing aspect ratio or resolution on iOS and tvOS VLC applications, so we need sample code + file(s)

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: [tvOS] issues with setVideoAspectRatio via VLCKit

Postby ssbmaccom » 24 Apr 2019 19:10

i already uploaded a file for the bug report, please see there.
I played a bit and it may have to do with contraints and autolayout. When i set the frame of the UIView passed to VLCKit manually after setting the vAR then i get a flicker but it seems to work.
I need to do more experiments, but it looks like when the stream switches to 4:3 (or the user does) the video size is set to 1440:1080 and then back to 1920:1080 twice. Then the switch to 16:9 does not get handled, as the view is already 1920:1080. Documentation says that vAR events may not be handled in time - so it might get lost.
On the other hand manually setting the frame of the UIView is not a perfect solution as Apple recommends against this, but suggests to use autolayout and edge constraints (not constraints for width and heightk.

I currently can‘t do further experiments, as I am currently on vacation in Tunisia.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 20 guests