Results 1 to 10 of 10

Thread: Publish live streams using server side API (without .stream files)

  1. #1

    Question Publish live streams using server side API (without .stream files)

    Hi!

    How can we publish a stream without .stream file?

    I search through the forum and articles, and saw couple of similiar questions, but no answer.

    What we would like to achieve, is Wowza reading configuration from remote server and publishing/unpublishing streams according to the data. So lets say it gets the following (pseudo)data:

    {
    "stream1":"rtmp://server1/app1/stream1.stream",
    "stream2":"udp://127.0.0.1:6550"
    }

    and now we want to publish those streams. Could not find any method that would accept plain URL instead of .stream file.

    Many thanks, Alex.
    Last edited by AlexeyTs; 07-22-2014 at 01:30 AM.

  2. #2
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Hi Alex,

    You can use the Streamname Alias Addon or the Alias API

    Richard
    Last edited by rrlanham; 07-22-2014 at 04:44 AM.

  3. #3

    Default

    Hi Richard,

    thank you for reply. Those were the first articles we examined. But once again, those methods operate stream names only, no option to provide stream URL.

    We need something like that:

    publisher.setStreamSource("udp://127.0.0.1:6350");
    publisher.publishStream();

    if you see what i mean. Stream _name_ does not matter, we can change it with Alias or whatever else, what matters is actual _data source_ for the stream being published.

    Many thanks, Alex.

  4. #4
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    I corrected previous to show the Alias API rather than MediaCaster API, but you will need that, or the alias addon, too.

    You need to alias the stream URLs for most players and most uses. A URL stream name will work in Wowza test players, but not in most or any commercial players.

    This is what you need to do:

    UDP/RTSP source > pull with Wowza MediaCaster > Alias (addon or api) resolver > Stream Class Publisher.


    String streamname = "udpsource"
    
    MediaCasterStreamMap mediaCasterMap = appInstance.getMediaCasterStreams();
    MediaCasterStreamItem mediaCasterItem = mediaCasterMap.acquire(streamName);
    
    publisher.setStreamSource(streamname);
    publisher.publishStream();
    To support the above with the StreamNameAlias addon, you would have a rule in the stream alias file like this:

    udpsource=udp://127.0.0.1:6350
    Richard
    Last edited by rrlanham; 07-22-2014 at 06:21 AM.

  5. #5

    Default

    It once again invoke a necessarity to have some preconfigured files. We try to avoid it to have fully dynamical system, where streams configuration can be automatically changed on the fly with commands from remote server.

    Lets say there is a server that implements business logic and rules, and numerous Wowzas that read configuration from there (or being notified by Server about updates) and change streams accordingly. Remove old ones, create new ones, change source URLs.

    So far the closest option we found is to read the configuration from remote Server, update stream files from Java code, and use MediaCaster to stop/start updated stream file. But we look forward to better option that does not involve files and just allow to create and delete streams from code?

    Many thanks, Alex.

  6. #6
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Alex,

    I mention using the alias addon which involved configuration files, but you can use the alias api instead.

    Richard

  7. #7

    Default

    Thank you Richard, looks like we got there with alias API.

  8. #8
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Cool! Thanks for the update, Alex.

    Richard

  9. #9

    Default

    MediaCasterStreamManager starts stream, URL resolved by IMediaStreamNameAliasProvider2 to URL1.

    Now update came, logic in AliasProvider changed, it would resolve same stream to URL2.

    Is there any method to force stream to re-request URL from AliasProvider and connect to new URL, or it needs to be fully stoped and started again from MediaCasterStreamManager?

    Thanks!

  10. #10

    Default

    Hi Alex,

    the resolveStreamAlias methods normally only get called once when the mediaCaster first starts and doesn't get called when it resets.

    The simplest way would be to stop & start the mediaCaster when the url changes. This will ensure that the method is called properly.

    It is possible to manually change the url after a reset occurs but just before the new connection is made but it can be a complicated process.

    Roger.

Similar Threads

  1. Replies: 0
    Last Post: 01-03-2012, 09:28 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
  •