Forum Discussion

httpslash's avatar
httpslash
Visitor
12 years ago

How to stream http stream?

Hey guys, I've been trying to stream this for a while but although it plays, it palys for a minute then repeat what has already been played. I have had success using a certificate chain file and as destruk suggested, however, it wont work with the other streams. Can anyone please help, i've been trying forever and i'm losing hope.

30 Replies

  • I can't tell you exactly why that stream is failing, although I'm sure it has something to do with the peculiar reuse of sequence numbers. I can tell you however that the Roku player ignores the EXT-X-ALLOW-CACHE header, so that's not related.

    --Mark
  • "EnTerr" wrote:
    i believe caching explains all of the behavior here - how Roku plays the same video loop, repeatedly - and VLC plays linearly. None of your arguments explain that, do they?


    I've seen many examples of the Roku looping when trying to play a non-compliant HLS stream, or even a spec-conformant stream that just doesn't adhere to what Roku "recommends" for HLS playback in terms of numbers of segments and segment durations. For example, I've seen it go into a loop when trying to play a sequence of segments with a short duration followed by a segment with a much relatively larger duration, eg. 4s, 3s, 5s, 15s. Normally there are enough upcoming segments to prevent problems, but in a case like this, for instance after it gets done playing the 3 short segments (12s total duration), the longer (15s) segment hasn't been written yet, and the Roku goes into a loop. Having more segments and having their durations be more consistent helps alleviate these kinds of problems, as long as you don't start trying to read from too close to the end of the file. I could cite other cases too, the point being that the Roku's looping behavior can easily occur (based on my personal experience) in a number of different situations. I disagree with your statement that none of my arguments explain the looping behavior. As RokuMarkn says, it's most likely a sequence number issue.
  • "RokuMarkn" wrote:
    I can't tell you exactly why that stream is failing, although I'm sure it has something to do with the peculiar reuse of sequence numbers. I can tell you however that the Roku player ignores the EXT-X-ALLOW-CACHE header, so that's not related.

    That's good to know (that Roku does not follow the HLS spec in the case of EXT-X-ALLOW-CACHE) - then there is no point of putzing around with it.
    Will "salting" the URLs help instead to prevent caching?
    I.e. adding a unique query-strings behind, so no two URLs are textually equal.
  • "EnTerr" wrote:

    That's good to know (that Roku does not follow the HLS spec in the case of EXT-X-ALLOW-CACHE) -


    Roku follows the spec by never caching content. That is correct behavior regardless of the EXT-X-ALLOW-CACHE setting.

    --Mark
  • "RokuMarkn" wrote:
    Roku follows the spec by never caching content. That is correct behavior regardless of the EXT-X-ALLOW-CACHE setting.

    OIC. Agreed, not caching content and ignoring EXT-X-ALLOW-CACHE would be kosher with the spec.
    This new info i think sinks my caching theory; probably not worth trying salted URLs.
  • Ok, I think I've solved the mystery.

    I went back and tried to play the first link from the first post for myself this time, using VLC. It only played for 41 seconds then stopped.

    I then tried playing the stream using the link from the web site, http://www.latvdefrance.com/stream/live/name/tf1. It played from 01:44:38 to 01:45:19 (the last 41 seconds) then stopped.

    When I first visited the web site it said, "Vous n’êtes pas connecté, votre accès est limité à une minute! Créez un compte pour accéder à 12h d’essai gratuit".(Translation: You are not logged in, your access is limited to one minute! Create an account to access 12 hours of free trial). Even after I created an account and logged in, it still wouldn't play more than the last 41 seconds of the stream. There were also messages about requiring a paid subscription to view the live streams.

    I tried playing their streams from previous days' TV on my Roku. They played just fine.

    Conclusion: The live streams won't play more than a minute's worth of content unless you supply the appropriate credentials for a valid paid-up subscriber account.
    ---------------------------
    It still seems a little odd that the server would generate a playlist file reusing the same 6 segment files over and over again. I'm not surprised though that VLC and my browser's media player only played the last 41 seconds, whereas the Roku kept looping, It's been my observation that the looping is normal behavior for the Roku when it gets confused playing an HLS stream.
  • That's odd. Even with a trial subscription, I was able to play the stream without any repeats/stops, I know this because I was able to watch a soccer game. What I do know however is that if you're not a subscriber or trial subscriber in this case, the stream link which is in page source(not hidden at all) is different. The stream link( which is http) is named to indicate it is a demo. I'm guessing that by playing the non http stream link, vlc connects to the demo link which is why it stops after 41 seconds as non subscribers only get 1 minute. So I think it must be something else
  • Where were you watching the soccer game with your trial subscription -- on your Roku??
  • "belltown" wrote:
    It still seems a little odd that the server would generate a playlist file reusing the same 6 segment files over and over again. I'm not surprised though that VLC and my browser's media player only played the last 41 seconds, whereas the Roku kept looping, It's been my observation that the looping is normal behavior for the Roku when it gets confused playing an HLS stream.

    Well it clearly should've been trimming the past segments (i.e. slide the window) since they are overridden/deleted. And should bump the EXT-X-MEDIA-SEQUENCE with that. And should've spelt EXT-X-ALLOW-CACHE correctly and try to give it the right argument. And specify EXT-X-TARGETDURATION that won't be exceeded. And re-using file names is not that bright idea either, under Postel's law.

    This particular m3u (the first one i have looked inside, to be honest) - makes me appreciate the kind of shiddy* video streams that a player like Roku has to handle. One can trust if something can be misused - it will be**. And if it simply cannot be misused - it will be, anyway (Murphy's law corollary). Regardless, the player will be expected to go above and beyond and play the video - just like web browsers have to deal with screwy html.

    (*) portmanteau word, of organic fertilizer and "shoddy"
    (**) i remember someone kept a trail of all the things that different RSS feeds have done wrong - i think their company have written an aggregator of late Google Reader kind and had to apply different patches for thousands of feeds - hard to believe how long the list was. (I am trying to remember where was that but no luck so far.)