Results 1 to 3 of 3

Thread: Detect File/Stream Not Found for HTTP Streamers

  1. #1
    Join Date
    Dec 2011

    Default Detect File/Stream Not Found for HTTP Streamers

    May be somewhat verbose, but trying to hit all the things I've tried and maybe it'll be useful to someone in the future. I'm looking for some event/mechanism/way to signal successfully started http streamer sessions in a module. Successful meaning anything that has the potential to serve 1 segment (actually exists), somewhat equivalent to the "play" event in flash/rtmp. Up until that point of the "play" the connection hasn't failed. Usually this is easily done by just handling the not found case, but there doesn't seem to even be a way to programatically handle bad stream/filenames, especially the http streamers.
    Specifically I'm interested in Cupertino/HLS but is there anyway to discern if an IHTTPStreamerSession attempts to open a non-existent file/stream for any of the streamers? SanJose/Cupertino/Smooth/MpegDash?

    I'm doing this for analytics for all stream types. For RTMP streams this seems to be somewhat easy as I'm not interested in the plain RTMP connection, only a successful play event. So all I have to do is wait on the IMediaStreamActionNotify.onPlay method to get hit and assume anything else is an invalid connection/invalid stream/file (this is one of the unfortunate things...I have to assume over 9000 times and hope that's how it actually works). RTP was a little bit trickier and I'm unsure if you'd consider this a bug. For VOD content and RTSP playback the IMediaStreamActionNotify.onPlay is always notified regardless of if the file exists or not. Why should onPlay get called if the file doesn't exist? You don't do that for RTMP, why do it for RTSP? Note the onPlay is also called in IRTSPActionNotify, so I'm guessing because onPlay is called in that interface the same is done for IMediaStreamActionNotify? Just seems weird.

    For live streams using RTSP playback nothing in IMediaStreamActionNotify (or IRTSPActionNotify) will fire if stream doesn't exist (sort of why it seems like a bug). For VOD though because I couldn't reliably use the IMediaStreamActionNotify.onPlay event I also use the IMediaReaderActionNotify interface. Here I'm assuming that if the onMediaReaderOpen method never gets called there was a problem somewhere along the lines of playing the stream (which is fine I don't care about problematic plays) or there was specifically an exception thrown attempting to open a file that doesn't exist. As I can see in the wowza log the exception is always being thrown in the IMediaReader when it attempts to call open() when playing a file that doesn't exist.

    So that handles RTMP/RTSP...but what about HTTP and friends. Since there really is no "play" idea at all in http streaming that gets a little more difficult. As I can't personally catch the exception thrown by the IMediaReader since another class wrapping that already catches and swallows the exception I'm guessing. I think for VOD I can still use IMediaReaderActionNotify and determine that if onMediaReaderOpen isn't called, the file doesn't exist. However I see no solution at all for LIVE cupertino and friends. Are there any other Notifier classes maybe I'm missing? Or undocumented tricks to handle the HTTP stuff?

    All I'll see happen in turns of events for a non-existant live stream


    Then I'll see in the logs HTTPStreamerAdapterCupertinoStreamer.onPlaylist reporting an error opening the stream. And after a sizeable timeout (I assume the server is waiting for the client to ask for more segments, and if it doesn't then disconnection logic follows) finally ending with the two interfaces. Unsure of the order since it seems to happen asynchronously later, it seems the stream is destroyed prior to the http session though.


    But with no discernable way of knowing there was an error. So again either looking for some event that only happens on successful http "plays", or some way to catch/detect a failed play.
    Last edited by nicholi_s; 05-05-2015 at 08:44 PM.

  2. #2
    Join Date
    Dec 2011


    Actually using IMediaReader with HTTP vod streams is still somewhat problematic, as the create/init/open methods get called 2-3 times when a stream starts. Can be handled, but just becoming weirder and weirder.

  3. #3
    Join Date
    Dec 2011


    Further addendum, it's really JUST live Cupertino that results in different behavior. For SanJose, Smooth, and MpegDash if you attempt to play a live stream that does not exist the IHTTPSessionNotify.notifyHTTPSessionCreate never even fires, so they work beautifully. In exactly the same manner that Rtmp/Rtsp work for live. But for whatever reason for Cupertino the connection continues, and sort of makes it impossible to distinguish successful from failed plays. Why is this?

Similar Threads

  1. Replies: 3
    Last Post: 08-04-2014, 03:37 AM
  2. Dispersa distributed monitoring service for Wowza streamers
    By Yury Udovichenko in forum Showcase
    Replies: 0
    Last Post: 01-20-2014, 10:26 PM
  3. Detect fragment number in San Jose stream (Flash HTTP)
    By slalompoint in forum Live Streaming and Encoder Discussion
    Replies: 2
    Last Post: 01-20-2012, 12:44 AM
  4. Resources being used for HTTP Streamers and Live Streaming Packetizers
    By derrick217 in forum Media Players and Devices Discussion
    Replies: 1
    Last Post: 12-13-2011, 04:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts