How To Stream Video Using Azure Media Services


The future of online media will be creating your own Network.

Azure Media Services

Click Here, I have linked where you can learn the basics about the cloud platform.

Creating a network or channel has become an easier process with tools like Azure Media Services, and I want to provide some context as to why and a short “how to”.   The difference in services like these as opposed to Twitch are instead of streaming to a platform set-up via Twitch, the host would provide their own platform i.e. website, chat, viewers, and anything else desired.

The ability to turn a profit is evident with streamers reaching 20k+ subscribers on Twitch.  I think the next logical steps will be big personalities going away from controlled third party streaming services and creating their own network.  Creating your own channel comes with a lot of different logistics.  For example, a streamer/owner will not only have to secure the subscriptions as well sponsorship, but more traditional advertising will also become a necessity.  With this being “new media”,  traditional ad formatting will not work as we see people moving away from cable and satellite.   Because YouTube ad roll is a constant complaint, innovation will have to play a huge role in the process.  One of the best examples currently doing this right now is Dr. Disrespect on Twitch.  The character is a bravado filled, alpha-male villain straight out of an 80’s movie played by Guy Beahm.  During his daily Monday through Friday show, the production is filled with elements not used or seen on the platform anywhere else and improvised interaction with the audience by incorporating state of the art advertising has created a unique jargon between the Dr and his audience, the Slick Daddy Club.    G-Fuel,  an energy drink that has sponsored him,  is utilized if he is having a real or perceived slow energy day and the audience will tell him to take his G-Fuel or get “G-Fuel’ed” out of his mind.   Another example is for Asus.  During times Dr. Disrespect wants to express his greatness,  he goes into his trophy room.  Not just his trophy room but the “Asus Republic of Gaming Trophy Room”.  So he has taken the audience and made them part of the ad and they often ask in chat to be taken there.  This will be the sort of innovation and creativity required in advertising for a network to succeed.

Why would these bigger broadcasters ever transition from Twitch when they are making a substantial profit?  There are actually many reasons,  but two of the biggest are:  control and more revenue.   First off, controlling your own channel means the ability to sell time slots under your own name with a guaranteed audience, the ability to innovate and implement ideas without waiting for a platform which has to take every stream into account or may implement something disagreeable to your preferences.  Then comes revenue.  Currently Twitch has profit sharing and as broadcasters grow bigger, they have more room to ask/demand a bigger cut which is great and gives them a bit of power.   But Twitch also has rules on which ads they will play and the sort of content advertised on their network.  This is can lead to loss of revenue for the stream without the broadcaster even knowing it.  The ability to accept advertising at different levels and amounts is something Twitch has total control of.  There is also one thing I would like to add on this subject;  if one streamer starts a controversy and Twitch is somehow irreparably damaged, this will affect everyone.  This sort of conjoined ecosystem can be good and bad.

The great and well known (AMS), a channel denote as well as a pipeline for streaming video content, will receive live input streams in one of two methods: A dynamic encoder drive;  a stream at just a single transmission rate to the activated channel to make live encoding employing the Media Services in one of these formats: RTMP, RTP (MPEG-TS), or maybe Smooth Streaming. The channel then performs the real-time encoding of the single-bit stream entering into the multi-bit (adaptive) video stream. When prompted, Media Services provides the flow to customers.

A Single Bitstream Stream

You can use these great live encoders which produce a fantastic Smooth Streaming stream: MediaExcel, Ateme, Imagine Communications, Envivio, Cisco, and Elemental. These live encoders create a stream in RTMP design: (AFMLE), the Adobe Flash Media Live Encoder, the Telestream Wirecast, the Haivision, the Teradek, as well as the Tricaster. The live encoder could also send a single bitstream stream to a channel which is not enabled for a Live Encoding, however, this is never recommended. When prompted, Media Services provides the flow to customers.

Starting with the version of Media Services 2.10, when you create a channel, you can specify how you want it to receive the input stream. You can also specify whether or not you want the channel to perform real-time encoding of your feed. Two options are available:
Note: Specify this value if you plan to use a local live encoder that will produce multi-bit streams (a pass-through stream). If necessary, the incoming stream is transmitted to the output without encoding. This is the behavior of a channel before version 2.10. For more information about using such channels, see video streaming with local encoders that create streams at multiple transmission speeds.

Standard: Choose this value if you plan to use Media Services to encode your single bit rate live stream to multiple bit rates. Remember that there is an impact on billing for live encoding and leaving a real-time encoding channel in the Active state results in billing charges. It’s recommended that you stop your running channels immediately after your real-time streaming event is over to avoid extra hourly charges.
Invoicing Implications

The billing of a real-time encoding channel starts as soon as its status changes to Running via the PLC. You can also view the status in the Azure portal or the Azure Media Services Explorer tool.

Once a channel is in the Running status via the API, or in the Ready or Streaming status in the Azure portal, billing is active. To stop the billing, you must stop the channel via the API or perhaps in the Azure portal. You’re responsible for stopping your channels when you have finished using the real-time encoding channel. Not stop an encoding channel causes continuous billing.

The Channel States and Billing Mode Mapping

The Present State Of A Channel, Possible Values Include:

          Stopped: This is sure the initial state of the channel after it’s created (unless autostart has been selected in the portal). No billing occurs in this state. In this state, channel properties can be updated, but streaming is not allowed.

           Starting: The сhаnnеl is being ѕtаrtеd. No bіllіng оссurѕ in thіѕ state. Nо uрdаtе оr ѕtrеаmіng іѕ allowed durіng thіѕ ѕtаtе. If an еrrоr occurs, thе channel returns to the Stopped state.
Execution in progress: The channel is capable of processing dynamic flows. It now charges for use. You must stop the channel to prevent additional billing.

             In the process of being stopped: The channel is being ѕtорреd. Nо bіllіng оссurѕ іn thіѕ trаnѕіtіоn state. Nо update оr perhaps streaming іѕ аllоwеd all through thіѕ ѕtаtе.

              Delete in progress: The сhаnnеl іѕ bеіng dеlеtеd. Nо bіllіng occurs іn thіѕ trаnѕіtіоn ѕtаtе. Nо uрdаtе оr ѕtrеаmіng is allowed throughout this state.

Automatic Closing Of Unused Channels

Since 2016, Media Services has deployed an update that automatically closes a channel (with real-time encoding enabled) if left unused for a long time. This applies to channels that have no active program and that have been left in the execution state without an input contribution stream for an extended period.

The nominal threshold for the unused period is 12 hours, but it’s subject to change.

Real-time encoding workflow

Streaming workflow in which a channel receives a single bitstream ѕtrеаm іn оnе оf thе fоllоwіng рrоtосоlѕ: RTMP, Smооth Strеаmіng, or RTP (MPEG-TS). It thеn еnсоdеѕ thе stream іn a multiple bit rate stream.

RTP (MPEG-TS): MPEG-2 transport stream via RTP.
Conventional use cases:
Professional broadcasters typically use hіgh-еnd lосаl dynamic encoders from providers lіkе Elеmеntаl Technologies, Erісѕѕоn, Ateme, Imagine or Envіvіо tо ѕеnd a ѕtrеаm. They are often used in conjunction with an IT department and private networks.
The use of a Single Program Trаnѕроrt Stream (SPTS) input іѕ ѕtrоnglу rесоmmеndеd.
You can use up to 8 audio streams using MPEG-2 TS via RTP.
The video stream must have an average bitrate of less than 15 Mbit/s.
The total of the average bit rates of the audio streams must be less than 1 Mbit/s

Here Are The Supported Codecs:
         MPEG-2 / H.262 Video
         Profile Main (4: 2: 0)
         Profile High (4: 2: 0, 4: 2: 2)
         Profile 422 (4: 2: 0, 4: 2: 2)
         MPEG-4 AVC / H.264 Video
         Profile Baseline, Main, High (8 bits 4: 2: 0)
         Profile High 10 (10 bits 4: 2: 0)
         Profile High 422 (10 bits 4: 2: 2)
         Audio MPEG-2 AAC-LC
         Mono, Stereo, Surround (5.1, 7.1)
         MPEG-2 Style ADTS Format
         Dolby Digital (AC-3) Audio
         Mono, Stereo, Surround (5.1, 7.1)
         Audio MPEG (layers II and III)
         Mono, stereo

The Recommended Broadcast Encoders Are:
         Imagine Communications Selenio ENC 1
         Imagine Communications Selenio ENC 2
         Elemental Live

Known Issues

The channel starting time has been improved to an average of 2 minutes, but sometimes growing demand can take up to 20 minutes, and the RTP support is adapted to the professional presenters. The slate image must conform to the restrictions described herein. If you try to create a channel from a default slate with a resolution greater than 1920 x 1080, the query ends with an error. Again, remember to stop your channels when finished streaming. Otherwise, invoicing continues.

There are some drawbacks to going out on your own. The initial investment would be costly as you would need a production quality studio with a team, as well as the web development required to take the feed and broadcast it to your site.   As a streamer you would also be opening yourself up as direct competition and live-streaming platforms often have in their TOS ( term of service) that duel live streaming is not allowed so you would not be able to take advantage of both.

Currently in my mind the best way to implement a new network would be instead of an individual creating it, an Esports organization or corporation with collaboration of a few broadcasters.  They could fill the time slots and get content quickly with free and pay for shows to draw viewers.  Sirius/XM did this and Howard Stern was able to make up the terms of his contract.  It has been done in the past with success.

Azure Media Services


Leave a Reply

Your email address will not be published. Required fields are marked *