Results 1 to 8 of 8

Thread: Silent stream using IMediaStreamNameAliasProvider2

  1. #1
    Join Date
    Jul 2011
    Posts
    104

    Default Silent stream using IMediaStreamNameAliasProvider2

    Hey guys!

    I'm trying to create a stream name alias for a Shoutcast stream using the IMediaStreamNameAliasProvider2 interface.

    Let's say that the Shoutcast broadcast I'm trying to consume comes from the following URL: http://broadcaster.mydomain.com/stream.aac

    In the implemented methods in my module I'm simply returning a stream name of "test" for testing, so that I can include the origin URL in the stream name and not include it inside the Application XML (so I can choose which broadcasts use diff origin servers and what not).

    Now, in the module that implements the IMediaStreamNameAliasProvider2 interface, I've returned a simple stream name for testing, aptly named "test";

    I can see that the stream "test" is in fact present on the application instance, however I can't hear anything, and I'm not getting any errors on server or on the client. Also, recording doesn't seem to work either. No errors there as well, the file just never shows up in /content as the stream plays, and I'm sure that both those issues are related.

    Other stream types that are not shoutcast work just dandy. So I'm sure I'm just missing something here.

    Oh, and btw I also verified that the stream type is being set to shoutcast via setStreamType before play is called.

    Any ideas as to where I'm going wrong?

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    "test" could be an alias, but what you want to return is the SHOUTcast URL. The IMediaStreamNameAliasProvider2.resolve*() methods receive the alias and return the actual stream, which in your example is the SHOUTcast url

    Richard

  3. #3
    Join Date
    Jul 2011
    Posts
    104

    Default

    Oh jeez, that makes sense actually.

    So that means I'm totally getting the IMediaStreamNameAliasProvider2 usage backwards a tad then. So pardon my confusion what using this module how do I "set" or create an alias for a stream with a complex name?

    Thanks so much man, you da bess.

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    If you know all the aliases you are going to use and what stream name each maps to you can use the StreamNameAlias addon instead of IMediaStreamNameAliasProvider2
    http://www.wowza.com/forums/content....ameAlias-AddOn

    Using IMediaStreamNameAliasProvider2 you might connect to a db to look-up the actual stream. IMediaStreamNameAliasProvider2 is for integration with other systems and/or complex logic for resolving aliases, or whatever you can't do with wildcards and environment variable in a alias mapping file using StreamNameAlias.

    Richard

  5. #5
    Join Date
    Jul 2011
    Posts
    104

    Default

    Hey Richard!

    Cool, I'm using the StreamNameAlias AddOn now.

    Have it all hooked up, and here's the alias mapping from my aliasmap.play.txt:

    http://*=${AppInstance.Name}
    *=${Stream.Name}

    And the alias mapping from aliasmap.stream.txt:

    *=${Stream.Name}

    When I play a SHOUTcast stream with the stream name of "http://broadcaster.domain.com/8c7f55a306f0c06e15b5376a6dc0c777.aac" I see this in my console:

    INFO server comment - StreamNameAliasFile.load[/Library/WowzaMediaServer/conf/aliasmap.play.txt]: size:0:2 hash:false matchAll:true
    INFO server comment - ModuleStreamNameAlias.nameToAlias[play]: streamName:http://broadcaster.domain.com/8c7f55...6a6dc0c777.aac alias:{pattern: "http://*" alias:"${AppInstance.Name}" wildcardMatches:{[0]: "broadcaster.domain.com/8c7f55a306f0c06e15b5376a6dc0c777.aac"}} result:bb490d9dbcf6b75ac5a3aa1c12837038
    INFO server comment - MediaStreamMediaCasterPlay: startPlay
    INFO stream create - -
    INFO stream publish bb490d9dbcf6b75ac5a3aa1c12837038 -
    INFO server comment - ShoutCastReceiver.init: shoutcastMP3GroupCount:4
    INFO server comment - StreamNameAliasFile.load[/Library/WowzaMediaServer/conf/aliasmap.stream.txt]: size:0:1 hash:true matchAll:true
    INFO server comment - ModuleStreamNameAlias.nameToAlias[stream]: streamName:bb490d9dbcf6b75ac5a3aa1c12837038 alias:{pattern: "*" alias:"${Stream.Name}" wildcardMatches:{[0]: "bb490d9dbcf6b75ac5a3aa1c12837038"}} result:bb490d9dbcf6b75ac5a3aa1c12837038
    Which appears as if it's converting http://broadcaster.domain.com/8c7f55...6a6dc0c777.aac to bb490d9dbcf6b75ac5a3aa1c12837038, which is what I want but it's still silent, I can't hear anything.

    Any ideas what I'm doing wrong?

  6. #6
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Looks like you have it turned around again. You play the alias. In the play alias file you have the alias on the left and the real stream (the SHOUTcast url) on the right.

    If you are starting SHOUTcast streams in StreamManager or /conf/StartUpStreams.xml you would use the stream alias map file. But same thing there, you start the stream and play it with the alias.

    Richard

  7. #7
    Join Date
    Jul 2011
    Posts
    104

    Default

    I'm so dumb!

    in my play alias file i changed it to:

    http*=http://broadcaster.domain.com/${Stream.Name.Part2}

    And in the client I pass in http/whatever.aac

    Sweet baby Jeebus it works, THANK YOU!

  8. #8
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Cool, funny. Thanks for the update. Glad it's working

    Richard

Posting Permissions

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