Results 1 to 6 of 6

Thread: Auto Detect origin server ip from edge server's application

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Auto Detect origin server ip from edge server's application

    Hi,
    I am trying to setup wowza cluster with multiple origin servers. For publishing a stream any one of origin server is being picked up and stream is sent to it from flash client (also i am storing the mapping of stream id vs origin ip in my db) . Now on the other end (consumption of stream) the video player knows ip of edge server (from load balancer) and appname (say "EdgeApp") but the "EdgeApp" doesnt know at which origin the video stream is .
    I dont want to use the timeout approach (ie configuring origin ip on edge as [origin-ip1] | [origin-ip2] | ...)
    i want to create a custom module on "EdgeApp" which can go and read the db for origin ip and get the required stream from that origin server. Any pointers regarding which classes should i start looking at ?

    Thanks,
    Gaurav

  2. #2
    Join Date
    May 2013
    Posts
    680

    Default

    Hello Gaurav

    If you are going to take the approach of utilizing a database as your central repository, I'd suggest being very cognizant of the time it takes to make the requests especially if you are going to do it on-demand while resolving the origin. It may pay to thread the requests and keep a synchronized map updated. You will want to take a look at the IMediaStreamNameAliasProvider2 interface to get started.

    Also, we are working on a module that will dynamically locate the source stream in a similar manner. We don't have a timeframe for delivery. Upon our completion of the module, would you like to be a tester?

    Thanks,

    Matt

  3. #3

    Default

    Quote Originally Posted by matt_y View Post
    Hello Gaurav

    If you are going to take the approach of utilizing a database as your central repository, I'd suggest being very cognizant of the time it takes to make the requests especially if you are going to do it on-demand while resolving the origin. It may pay to thread the requests and keep a synchronized map updated. You will want to take a look at the IMediaStreamNameAliasProvider2 interface to get started.

    Also, we are working on a module that will dynamically locate the source stream in a similar manner. We don't have a timeframe for delivery. Upon our completion of the module, would you like to be a tester?

    Thanks,

    Matt
    Hi Matt,
    I can see the extra overhead i will be bringing on the wowza servers with this approach. But it seems i have no other options . My current approach involves creating "n" edge applications on each edge server (where n = number of origin servers) where every edge application is mapped to one origin server. so its my webservers responsibility to tell the video player which app to hit . But using this approach involves restarting all the edge servers everytime a new origin server is added to cluster . Is there any other approach which you can suggest ?
    I will take a look at the IMediaStreamNameAliasProvider2 . And yes i would like to test out the module which you mentioned when its ready.

  4. #4

    Default

    Quote Originally Posted by matt_y View Post

    You will want to take a look at the IMediaStreamNameAliasProvider2 interface to get started.
    I played around with the IMediaStreamNameAliasProvider2 , all i could do with that class was to override the stream name while playing video. I am looking for a way to override the origin ip address when video player hits a edge server.

  5. #5

    Default

    Hi,

    In the IMediaStreamNameAliasProvider interfaces, there are resolveStreamAlias methods that are used to specify the actual rtmp url of the mediaCaster. In these methods, the requested stream name is passed in and the rtmp url is returned.

    In the resolvePlayAlias methods, you can change the stream name that the player requests or you can return null to prevent the player from connecting to a stream or triggering a mediaCaster startup. You can also use these methods as a trigger point to determine if a mediaCaster stream is actually available somewhere before the call to resolveStreamAlias is called. If it's available then you would return the name and continue but if it isn't available then you would return null and the player would receive a 404 response.

    If you do external lookups from the resolvePlayAlias methods then these should be cached locally as every player request will call these methods.

    Roger

  6. #6

    Default

    Hi ,
    Whats the difference between the two versions of overloaded method resolveStreamAlias . When i place breakpoints in both these method i observed that the in the first method resolveStreamAlias(IApplicationInstance appInstance, String name) the name parameter was "myStream" which is the requested stream name by video player.
    But in second method public String resolveStreamAlias(IApplicationInstance appInstance, String name, IMediaCaster mediaCaster) the name parameter was coming as
    wowz://localhost:1935/live/_definst_/myStream which is the value i used for origin url when i configured my edge application. So my question is in which of these two methods i should place my code which creates the url for connecting to origin.
    I also noticed if i place my code in second method (one with mediacaster param) this function gets called only once for a given stream. if i run multiple instances of video player the video seems to be playing in all but this function does not get calls more than once till i restart server.
    And if i place my code in first method mentioned above (without mediacater) the second method is never getting called.
    All the above testing was done when trying to play video using rtmp .

Similar Threads

  1. Liverepater :: Multiple origin server per-application on edge server
    By dilonge in forum Live Streaming and Encoder Discussion
    Replies: 3
    Last Post: 08-09-2013, 01:47 PM
  2. How to collect edge server's connections count
    By tujixx in forum Server-side Modules and Code Samples Discussion
    Replies: 2
    Last Post: 12-06-2012, 01:14 PM

Posting Permissions

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