HLS and PMC

It seems that PMC is not capable of switching between streams(of different resolutions) when using HLS?

 

If I return the url to the master.m3u8 in routine HTTPLiveStreamURL, PMC always seems to choose the first variant(and never switches).

 

An example playlist(which is played with resolution 384x216 in PMC):

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=327000,RESOLUTION=384x216,CODECS="avc1.66.30, mp4a.40.2"
index_0_av.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=845000,RESOLUTION=640x360,CODECS="avc1.66.30, mp4a.40.2"
index_1_av.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1581000,RESOLUTION=768x432,CODECS="avc1.77.30, mp4a.40.2"
index_2_av.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2620000,RESOLUTION=1024x576,CODECS="avc1.77.30, mp4a.40.2"
index_3_av.m3u8

 

The workaround I've been using is to get the master playlist in my plugin and then redirecting the one with the highest bitrate(or according to user selection).

 

Is there any other way around this(too avoid having to parse m3u8 lists)?

 

In Plex/Web, iOS etc it works as intended: 

  1. A segment from a low bitrate variant is first played
  2. If enough bandwidth detected -> switch to higher resolution playlist
  3. etc.

 

Just purchased a PlexPass and this problem is not present in Plex Home Theater, problem solved!

While PHT may work, i would recommend you try and make the code compatible with all/most clients. PHT is still in beta and not many people use it. 

As to the specific problem, take a look at the TouTV service code. I believe the commented code in the GetPlaylist() function will do what you want and make it compatible with a lot more clients. I'm not really sure why the code is commented out though. @Mikedm139 might be able to tell us why. 

While PHT may work, i would recommend you try and make the code compatible with all/most clients. PHT is still in beta and not many people use it. 

As to the specific problem, take a look at the TouTV service code. I believe the commented code in the GetPlaylist() function will do what you want and make it compatible with a lot more clients. I'm not really sure why the code is commented out though. @Mikedm139 might be able to tell us why. 

Thanks for the linked code example!

That code solves two issues:

  • PMC will play at the highest possible resolution
  • Other clients(that supports HLS fully) will still be able to switch between streams if bandwidth changes(the whole point of HLS)

But unfortunately it will make PMC(and PHT) not play at all if:

  • The m3u8 list contain relative paths

So now I have three different approaches(all with some kind of drawback) to choose from:

  1. Return the url to the original playlist. Highest compatibility but will/might make PMC play with a lower resolution
  2. "Sort" the playlist(according to above) and return. Will make PMC play at highest possible resolution. It is dependent on that the playlists contain absolute paths though, otherwise it won't work in PMC/PHT.
  3. Never return the master playlist, only return the one with the highest bitrate. This will make all clients play at the highest bitrate, but the very essence of HLS is lost

So the question is, what to choose?  :)

UPDATE:

In my specific case, I cannot choose 2 ... 

.. oh, and I think the reason why the code is commented out(in the link) is because PMC never reaches that branch(not compatible with encrypted HLS streams). No need for patching the list.

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