If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account

Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

HLS Video Loading Error through Chromecast

I have been messing around a plugin that already exists but that was not fully taking advantage of HLS. It was fetching the master playlist m3u8, parsing it's content and building the final URL with one specific m3u8 file. Since HLS is meant to adapt itself based on the current bandwitdth of a player, I decided i'd thrown in and skip the parsing/URL and building part and just return the master playlist in the media object part.

I have been able to play the HLS video from the desktop application on remote access. But when I tried to cast to to my chromecast (even with a Chromecast Ultra on a wired connection), I have the following error: Not enough bandwidth for any playback of this item. Cannot convert to below minimum bandwidth of 77kbps.

Best Answer

Now as for handling multi-quality m3u8s. It is best to just pull the multi-quality m3u8 stream URL offered by an online source and provide its media object attributes. The individual Plex player apps should read these multi-quality m3u8s and choose the best quality option to use, based on the users online video quality setting on that Plex player app.

Now supposedly the native software/SDK of a couple players/devices do not provide the option to read the various media values in a multi-quality m3u8 (though no one has ever told me what those specific players/devices may be). But the software/SDK for most players/devices used for Plex can and should be able to read and choose the qualities offered in a multi-quality m3u8.

But unfortunately some Plex player apps are just not programmed properly. So they just choose the first stream listed in a multi-quality m3u8, even if that is the lowest quality listed. The Android software, for example, is able to read and determine the various qualities offered in a multi-quality m3u8, but the Plex player apps for Andriod devices just chooses the first item listed. This issue has been reported to the Plex player app developers for Andriod devices, but they have yet to fix it.

Now you may find plugin code where the developer pulls the individual streams from a multi-quality m3u8 to work around a Plex player app that that is not properly programmed. But the plugin framework is not designed to access and parse m3u8 data (that is why the code for it can be confusing). And I personally believe that you should not use any "work arounds" to deal with issues with the various Plex player apps, because it does not encourage Plex to fix the issues with the individual Plex player apps that are not properly programmed.

And a work around that may fix an issue on one Plex player app may also create issues using another Plex player app. For example, splitting a multi-quality m3u8 into multiple media object versions may help you resolve issues using the Plex player app for Andriod devices, but Plex Web (browser interface) and Plex Media Player (PMP) do not even recognize multiple versions of a channel plugin media object, so that work around for Plex Andriod users would just create a new problem for Plex Web or PMP users.

Answers

Seems like adding those keys in the MediaObject will fix the playback on the chromecast :

video_frame_rate = 60,
video_resolution = 720,
audio_channels = 2,

But those settings are hardcoded from the playlist because I know they are the max possible values.. Is that okay? Should I use the minimal values from the m3u8 playlist? Would that change something on the playback?

First, I am a little confused by your code. If you are not going to use a separate URL service to create you media objects, then it is always best to create a separate function within your plugin for creating the media objects that can loop through twice and create the pre-play screens used by most players. Otherwise your success with playback on Plex player apps will be affected.

Thanks for the reply. Note that this is not my code and i'm trying to dig through an existing channel which was confusing to me at first. So if you would dare explain to me what is a separate URL service to create media objects, or point to where where I could learn the trick, i'd be happy to!

From what I see in the HGTV bundle, seems like the code assume 3 resolutions, but what if the master playlist contains other resolutions? isn't the goal behind HLS to let video players to use the master playlist as a reference to adapt itself based on the current bandwidth? I don't understand the need of hardcoding resolutions upfront as they are supposed to be in the master m3u8 playlist

The Channel Plugin Development Support Documents thread that is pinned to the top of this section of the forum contains documents I have created that can provide the basic concepts of plugin development. They are not in-depth tutorials, but they can help you understand the basics so you will know where to start, where to look next.or what questions you may need to ask, especially the Overview and FAQ.

So as for a better understanding of a URL service, in that thread I have created a document called "Introduction to URL Services" that will give you the basics of a URL service. And all of the URL services that are used for PlexIt/Watch Later videos and channel plugins in the Channel Directory are part of the Services.bundle and can be easily searched from Github, which makes them a great resource. See https://github.com/plexinc-plugins/Services.bundle

Now as for handling multi-quality m3u8s. It is best to just pull the multi-quality m3u8 stream URL offered by an online source and provide its media object attributes. The individual Plex player apps should read these multi-quality m3u8s and choose the best quality option to use, based on the users online video quality setting on that Plex player app.

Now supposedly the native software/SDK of a couple players/devices do not provide the option to read the various media values in a multi-quality m3u8 (though no one has ever told me what those specific players/devices may be). But the software/SDK for most players/devices used for Plex can and should be able to read and choose the qualities offered in a multi-quality m3u8.

But unfortunately some Plex player apps are just not programmed properly. So they just choose the first stream listed in a multi-quality m3u8, even if that is the lowest quality listed. The Android software, for example, is able to read and determine the various qualities offered in a multi-quality m3u8, but the Plex player apps for Andriod devices just chooses the first item listed. This issue has been reported to the Plex player app developers for Andriod devices, but they have yet to fix it.

Now you may find plugin code where the developer pulls the individual streams from a multi-quality m3u8 to work around a Plex player app that that is not properly programmed. But the plugin framework is not designed to access and parse m3u8 data (that is why the code for it can be confusing). And I personally believe that you should not use any "work arounds" to deal with issues with the various Plex player apps, because it does not encourage Plex to fix the issues with the individual Plex player apps that are not properly programmed.

And a work around that may fix an issue on one Plex player app may also create issues using another Plex player app. For example, splitting a multi-quality m3u8 into multiple media object versions may help you resolve issues using the Plex player app for Andriod devices, but Plex Web (browser interface) and Plex Media Player (PMP) do not even recognize multiple versions of a channel plugin media object, so that work around for Plex Andriod users would just create a new problem for Plex Web or PMP users.

Very interesting! Hopefully plex players will fix their issues because it is the goal behind having multi-quality m3u8 is to adapt the playback with the current bandwidth.

I guess that the Chromecast Plex player is one of those as it seems it cannot find the proper media object because it's lacking information (resolution, frame rate, etc). I also realised yesterday while watching a live stream that it was not adapting at all. I mean, if at times it was lacking bandwidth to display video, it displayed a spinning loader instead of lowering the quality.

Thanks for the information posted I will take the time to read about it.

You would need to check the codec support of the Chromecast player to see if it can direct play or must transcode HLS media. And the Chromecast playback is more complicated, since it is confusing to figure out what part is controlled by the Plex app for Chromecast and what part is controlled by the Plex app on your mobile device that you are casting the media from. You would definitely have to refer to the Chromecast section of the forum to isolate playback issues on the Chromecast app, since the casting makes any playback issues much more complicated.

There are a few live streams that I have found that will transcode on newer versions of Plex Media Server, due to the LiveTV/DVR feature, but that is very hit or miss. See the "Transcoding Live Streams in Channel Plugins" section of Known Plex player app and PMS issues supporting Plugin Framework thread pinned to the top of this forum.

Howdy, Stranger!

When logs (server or client app) are requested for an investigation, please do NOT turn on "verbose" logging unless it is explicitly requested. Verbose logging makes things much more difficult in the majority of cases.