Results 1 to 9 of 9

Thread: Origin To Edge Transcoding Setup Help Needed

  1. #1

    Question Origin To Edge Transcoding Setup Help Needed

    OK my first attempt to control the transcoding processing doesn't seem feasible: http://www.wowza.com/forums/showthre...op-Transcoding so I want to try a different approach.

    Scenario:

    I have about 100 streams coming into my server. At any one time lets say up to 20 of those streams are being viewed on the desktop by a Flash client and up to 10 of those are being viewed by iOS devices. I need the 10 iOS streams to be transcoded. I never know which of the streams are being viewed. I can't afford (and it doesn't seem practical) to have 100 inbound streams being transcoded. So my thought is to have the iOS devices view the stream from a different server and only when the stream is requested, will it pull the stream from the original server, transcode it, and deliver it.

    So:
    1) 100 streams come into server A
    2) 15 streams are viewed by Flash clients from server A
    3) 10 streams are viewed by iOS clients from server B which only pulls the stream from server A when requested
    4) Transcoding happens on server B when the stream is requested and I can add licenses if I see the traffic grows above 10 concurrent viewers.


    I tried to get this work with some type of repeater connection but I wasn't successful. The stream names are dynamic and constantly changing.

    First - is this possible, and second how might I configure the servers to get this working?

    Thanks!

  2. #2

    Default

    Hi,

    It is not possible to transcode streams on the fly on the edge like you are wanting to do.

    The reason is that the source stream must be a regular published stream. HTTP sessions use a different stream format which is not compatible with the transcoder.

    Roger.

  3. #3

    Default

    Quote Originally Posted by roger_l View Post
    Hi,

    It is not possible to transcode streams on the fly on the edge like you are wanting to do.

    The reason is that the source stream must be a regular published stream. HTTP sessions use a different stream format which is not compatible with the transcoder.

    Roger.
    OK so is there any other solution possible to the scenario I've outlined? You can see it's not reasonable to have 100 transcoder licenses (or have the server attempt to transcode that many at once which probably isn't even possible).

  4. #4

    Default

    Hi,

    The problem is that the startup time for HLS (iOS) streams is too long.

    HLS requires that the streams are packetized in chunks. These chunks are based on the stream key frame interval so for the first chunks to be created, there needs to be at least the first Key Frame and all of the frames to the next key frame to be available. This is not possible with live streams because the frames are delivered in real time. If starting the edge streams dynamically and creating the chunks on the edge, the delay until the first chunk would be too great and the player will timeout.

    When using HTTP repeaters, the stream chunks are created on the origin server and then when there is a request from the edge, the chunks are sent to the edge and then forwarded to the player.

    There is not an easy way around this to transcode http streams on demand.

    Roger.

  5. #5

    Default

    Quote Originally Posted by roger_l View Post
    Hi,

    The problem is that the startup time for HLS (iOS) streams is too long.

    HLS requires that the streams are packetized in chunks. These chunks are based on the stream key frame interval so for the first chunks to be created, there needs to be at least the first Key Frame and all of the frames to the next key frame to be available. This is not possible with live streams because the frames are delivered in real time. If starting the edge streams dynamically and creating the chunks on the edge, the delay until the first chunk would be too great and the player will timeout.

    When using HTTP repeaters, the stream chunks are created on the origin server and then when there is a request from the edge, the chunks are sent to the edge and then forwarded to the player.

    There is not an easy way around this to transcode http streams on demand.

    Roger.
    Roger - thank you very much for your help on this and your excellent explanation. Two questions then.

    1) Suppose I detect the iOS users in the page before I'm displaying my video. Could I trigger something on the backend in server side code to start pulling the stream to server B from server A? If so, I could just hold the user on that page for X seconds while the stream goes through the setup process, then redirects them to the page where they actually view the video. At that point, the iOS player won't have to wait (or wait long) because the stream has been setup.

    I can make that process happen, so the question would be, is my original scenario technically possible then, if I can control how long the iOS player is waiting for the stream.

    2) Is their anything I can do on my end that sets the iOS player timeout?

    Thanks!

  6. #6

    Default

    Hi,

    Technically, that might work.

    You would need a custom http provider on wowza that would listen for notifications from the web site to start the stream. At that point, you would call appInstance.startMediaCasterStream(String streamName, String mediaCasterType) to manually start the stream from the origin. Depending on the packetizer settings, it may be 10 - 30 seconds before the hls stream is ready for playback.

    To shut it down, you would monitor the http sessions to see how many are connected to the stream. After there have been no connections for a short time, you could shut down the mediaCaster using appInstance.stopMediaCasterStream(String streamName);

    You should allow time for players that might reconnect or start after the last player disconnects.

    You cannot really control how long a player will wait before returning a stream not found message. If the stream does not exist when requested, a 404 will be returned immediately. Using the above method, only the first players would have to wait.

    Roger.

  7. #7

    Default

    Quote Originally Posted by roger_l View Post
    Technically, that might work.
    That's enough to keep me going. I'll definitely start looking at the http provider samples. I've been testing with onHTTPSessionCreate/onHTTPSessionDestroy which I'm guessing I can use to help monitor whether I have active HTTP sessions and can help determine with other things when it's safe to shut down the stream.

    Could you please provide some input on what the application.xml files would look like on server A and server B. Do I still need to set them up as a repeater? In all the examples I see in regards to iOS playback, I see that I need to create a .stream file and use the Stream Manager. Are those the two steps that are replaced by the appInstance.startMediaCasterStream(String streamName, String mediaCasterType) you referenced above?
    Last edited by ImAStreamer; 09-11-2013 at 09:17 PM.

  8. #8

    Default

    Hi,

    You would be starting the streams manually on the edge, using the same api calls that the stream manager uses so your edge server would actually be configured as a regular live server.

    You would still need some way of referencing the origin stream which is what stream files do. You could also use the StreamNameAlias AddOn or API which replaces .stream files and would allow you more control over the stream names used on the edge.

    When calling appinstance.StartMediaCasterStream, the stream name used is what will be passed into the Alias API. If you are using .stream files then it would be the name of the stream file.

    Roger.

  9. #9

    Default

    I got it now - that makes sense. I'm starting by trying to get everything working manually. I am able to play the iOS transcoded stream from the edge successfully. However it always drops within a minute. If I play the iOS non-transcoded stream directly from the origin, it never drops.

    I think that should work properly before I begin to work on the server side code to control everything.

    Any ideas?

Similar Threads

  1. Transcoding on Edge or Origin? Does it Matter?
    By brad12 in forum AddOn: Transcoder
    Replies: 3
    Last Post: 08-10-2012, 11:12 AM
  2. Transcoding in origin/edge configuration
    By german in forum AddOn: Transcoder
    Replies: 11
    Last Post: 11-17-2011, 10:34 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
  •