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

mberube09mberube09 Posts: 4Members ✭✭

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.

You can see exactly the modification I have made here : https://github.com/mberube09/Lazyman.bundle/commit/66f27a4dff9ba91ea4146138d29ae36f2fdbfd4d

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.

This was working fine before my fix. Have I done something wrong?

Attached file is the Plex Media Server logs.

Best Answer

Answers

  • mberube09mberube09 Posts: 4Members ✭✭

    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?

  • shopgirl284shopgirl284 Posts: 2,786Members, Plex Pass, Plex Ninja, Forum Moderator Plex Ninja

    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.

    The HGTV channel plugin is an example of a plugin that does not have a separate URL service and includes a function to create the media objects for all of its videos- https://github.com/plexinc-plugins/HGTV.bundle/blob/master/Contents/Code/init.py#L265. And the RT-USA channel plugin includes a function to create the media objects for its live streams - https://github.com/plexinc-plugins/RTUSA.bundle/blob/master/Contents/Code/init.py#L131.

    Many issues and questions can be resolved by reviewing the Plex Support Documentation
    Providing details about your issue, Plex setup, and including log files are important when when asking for help on the forums.
    See Log Files
    Before posting channel plugin questions or issues, please review the pinned threads at the top of the Channel Plugin forum:
    READ FIRST: Guidelines for Posting Channel Plugin Issues/Questions and Things to Check First
    FAQ for Channel Plugin FAQ

  • mberube09mberube09 Posts: 4Members ✭✭

    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

  • shopgirl284shopgirl284 Posts: 2,786Members, Plex Pass, Plex Ninja, Forum Moderator Plex Ninja

    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

    The Plex Plugin Development Walkthrough, Framework Documentation, and the Plex support site's section for Channel Development Support documents can provide more specific and detailed instructions for the various parts of Plex channel plugin development.

    Many issues and questions can be resolved by reviewing the Plex Support Documentation
    Providing details about your issue, Plex setup, and including log files are important when when asking for help on the forums.
    See Log Files
    Before posting channel plugin questions or issues, please review the pinned threads at the top of the Channel Plugin forum:
    READ FIRST: Guidelines for Posting Channel Plugin Issues/Questions and Things to Check First
    FAQ for Channel Plugin FAQ

  • mberube09mberube09 Posts: 4Members ✭✭

    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.

  • shopgirl284shopgirl284 Posts: 2,786Members, Plex Pass, Plex Ninja, Forum Moderator Plex Ninja

    The "Plex Player App/Plex Media Server Issues" section of the READ FIRST: Guidelines for Posting Channel Plugin Issues/Questions and Things to Check First thread and the "Why won't any of the videos play on one or more of my channel plugins?"section of the Frequently Asked Questions for Channel Plugins thread that are pinned to the top of the Channel Plugin section of the forum provide more information on figuring out playback issues with channel plugin media on a specific Plex player.

    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.

    Many issues and questions can be resolved by reviewing the Plex Support Documentation
    Providing details about your issue, Plex setup, and including log files are important when when asking for help on the forums.
    See Log Files
    Before posting channel plugin questions or issues, please review the pinned threads at the top of the Channel Plugin forum:
    READ FIRST: Guidelines for Posting Channel Plugin Issues/Questions and Things to Check First
    FAQ for Channel Plugin FAQ

  • shopgirl284shopgirl284 Posts: 2,786Members, Plex Pass, Plex Ninja, Forum Moderator Plex Ninja

    And for live HLS streams, Plex is not supposed to be able to transcode live streams from plugins, so the player/device must be able to direct play HLS live streams. See Why Can I Not Get a Live Stream to Play on Plex?.

    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.

    Many issues and questions can be resolved by reviewing the Plex Support Documentation
    Providing details about your issue, Plex setup, and including log files are important when when asking for help on the forums.
    See Log Files
    Before posting channel plugin questions or issues, please review the pinned threads at the top of the Channel Plugin forum:
    READ FIRST: Guidelines for Posting Channel Plugin Issues/Questions and Things to Check First
    FAQ for Channel Plugin FAQ

Sign In or Register to comment.