How to stream to Alibaba Cloud

The Stream Targets feature in Wowza Streaming Engine™ live streaming software allows you to send live streams to widely distributed destinations. For example, you can send a live stream from a server running Wowza Streaming Engine software to an Alibaba Cloud CDN destination. This allows you to use the Alibaba CDN network to deliver the stream to viewers. This article explains how to set up Wowza Streaming Engine so that you can send a single live stream to an Alibaba Cloud destination for distributed delivery.
 

Notes:
  • Wowza Streaming Engine 4.6.0.03 or later is required.
     
  • Adaptive-bitrate streaming isn't support on Alibaba Cloud destinations.

Contents


Configure Alibaba Cloud to receive and distribute the stream Create an application in Wowza Streaming Engine to ingest the live source video
Create a stream target to send the stream to Alibaba Cloud
Enable Stream Targets
Test the connection
More resources

Configure Alibaba Cloud to receive and distribute the stream


Before you start, make sure you have an Alibaba Cloud account that has an ICP domain configured. Then sign in to Alibaba Cloud and create a stream URL that will be used to send the source stream from Wowza Streaming Engine to Alibaba Cloud CDN and deliver it for final viewing.
 
  1. Navigate to Alibaba Cloud and click Log In. Enter your Account username, Password, and the Verification Code captcha, and then click Sign In.
     
  2. At the top of the webpage, move your pointer over My Account and select View Console. This opens the AliCloud Console Home.
     
  3. In the AliCloud Console Products & Services block, under Storage & CDN, click Alibaba Cloud CDN.


     
  4. In the CDN Console navigation panel on the right, click CDN domain name list, and then click on the name of the domain you're sending the stream to.


     
  5. The Basic Information page provides the basic Stream Push Address, which you'll need when you create the stream target in Wowza Streaming Engine.

    The Stream Push Address URL is in the following format:

    rtmp://video-center.alivecdn.com/app-name/video-name?vhost=[your-domain]

    Where:
     
    • app-name is the name of the live application in Wowza Streaming Engine you're using to send the stream to Alibaba Cloud, such as live.
       
    • video-name is the name of the stream you're sending to Alibaba Cloud.
       
    • vhost=[your-domain] is the vhost query parameter, which takes the name of your ICP domain that you're sending the stream to ([your-domain-name]). For example, if the test domain is mydomain.cdnpe.com, the vhost query parameter would be: vhost=mydomain.cdnpe.com.
     
    Note: If you want to secure the stream, you must generate authentication tokens. See Configure token authentication.

Configure token authentication

If you want to secure your stream, you can generate and add an auth_key query parameter to the basic Stream Push Address, creating an authenticated URL.
 
  1. In the CDN Console, click Authentication Configuration in the navigation panel, and make sure Enable authentication function is turned on. If it isn't on, click the toggle button to turn it on, and then use authentication Type A, enter a Master Key, and click OK.
     
  2. Click Basic Information in the navigation panel, and copy the Stream Push Address URL leaving out only the vhost query parameter: rtmp://video-center.alivecdn.com/app-name/video-name.
     
  3. Click Authentication Configuration in the navigation panel, provide the following information and then click Generate:
     
    • Original URL - Paste the Stream Push Address URL, and replace app-name and video-name accordingly. For example, if your app-name is live and your video-name is mystream, the URL would be: rtmp://video-center.alivecdn.com/live/mystream.
       
    • Authentication Type - Use Type A.
       
    • Authenticator Key - Enter the Master Key value that you specified when enabling authentication. This is case-sensitive.
       
    • Effective Time - Enter the time, in seconds, the authentication token should be valid. For example, entering 3600 creates a token that is valid for one hour.
  4. Copy and paste just the auth_key query parameter at the end of the generated authentication URL into a .txt file, and save it. This information can't be viewed again after you leave the page. If necessary, you can repeat these steps to generate a new auth_key value.


     
    Note: To play an authenticated stream, you must also generate authentication URLS for each of the Live Streaming Addresses on the Basic Information page. One at a time, copy and paste the whole Live Streaming Address URL into the Original URL field, replacing the app-name and video-name. Then copy and paste the whole generated authentication URL into a .txt file and save.

Create an application in Wowza Streaming Engine to ingest the live source video


Next, create a live application in Wowza Streaming Engine Manager that will receive the live stream from an H.264 encoder or camera and send it to Alibaba Cloud for distributed delivery.
 
  1. Sign in to the manager, click the Applications tab at the top of the page, and then click live in the contents panel.
     
    Note: This article uses the live application that installs with Wowza Streaming Engine. If you want to use a different live application, select it instead from the contents panel.
  2. In the contents panel, click Sources (Live).
     
  3. Select the camera or encoder that you want to use as your video source, and complete the process of connecting the source to Wowza Streaming Engine. For more information, see How to connect a live source to Wowza Streaming Engine.
     
    Note: By default, Wowza Streaming Engine requires RTMP and RTSP sources to provide a user name and password to connect to a live application. For information on how to turn off authentication, see Managing live source authentication settings.

Create a stream target to send the stream to Alibaba Cloud


After the live application is created in Wowza Streaming Engine, it must be configured to send the stream to the Alibaba Cloud destination.
 
  1. In the contents panel, click Stream Targets and then click Add Stream Target.
     
  2. On the Add Stream Target page under Third-Party Target Destinations, click Alibaba Cloud. Wowza Streaming Engine sends the stream to Alibaba Cloud over RTMP.
     
  3. On the Alibaba Cloud Configuration page, provide the following information:
     
    • Stream Target Name - A descriptive name for this target setup in Wowza Streaming Engine. The name must be unique and can't contain less-than (<), greater-than (>), colon ( : ), quotation (' and "), forward slash (/), backslash (), pipe (|), question mark (?), asterisk (*), double-dot (..), or tilde (~) characters.
       
    • Source Stream Name - The name of the incoming stream that you specified in Wowza Streaming Engine when you set up the video source.
       
    • Destination Application Name - Alibaba automatically creates an application with this name. For simplicity, we recommend using the name of the live application you created in Wowza Streaming Engine Manager. Note that when working with the Alibaba Stream Push Address and Live Streaming Address URLs you must replace app-name
       
    • Destination Application Instance - Leave blank.
       
    • Destination Host - The hostname or IP address of the Alibaba Cloud CDN destination. For example, if your Alibaba Cloud Stream Push Address is rtmp://video-center.alivecdn.com/app-name/video-name?vhost=mydomain.cdnpe.com, the destination host is video-center.alivecdn.com.
       
    • Destination Port - Use the default port, 1935. Alibaba Cloud doesn't support other ports.
       
    • Destination Stream Name - Enter a name for the stream, using the following format: a name for the stream content (such as myStream) followed by the vhost query parameter and, if you're using authentication, the auth_key parameter from Alibaba's Stream Push Address URL.
       
      Note: When working with the Alibaba Stream Push Address and Live Streaming Address URLs, you must replace video-name with the name specified here, such as myStream).
      • If you're not using authentication, enter the following, replacing video-name and [your-domain-name]:

        video-name?vhost=[your-domain-name]
         
      • If you're using authentication, enter the following, replacing video-name, [your-domain-name], and [your-key]:

        video-name?vhost=[your-domain-name]&auth_key=[your-key]
  4. Click Add this target.

Enable Stream Targets


Before you stream, make sure to enable the Stream Targets feature for the Wowza Streaming Engine application and for the Alibaba Cloud stream target you created.

If you don't see a checkmark next to Stream Targets in the contents panel of the application, click Stream Targets in the contents panel and then click Enable Stream Targets. When prompted, click Restart Now so your change takes effect. When Stream Targets is enabled, a checkmark appears next to Stream Targets in the contents panel and the Stream Targets page shows Status is Enabled.



If the Status of an individual stream target is Disabled, click the Enable icon for the stream in the Actions column.



When a stream target is enabled, its status on the Stream Targets page is one of the following:
 
  • Waiting. The target is enabled but is not yet pushing the stream to the Alibaba Cloud destination because either the target's configured source stream is not connected to the Wowza Streaming Engine input or Wowza Streaming Engine has not completed initializing the connection to the Alibaba Cloud destination.
     
  • Active. The Wowza Streaming Engine instance successfully connected to the Alibaba Cloud destination and is actively pushing the stream.
     
  • Error. The Wowza Streaming Engine instance unsuccessfully tried to connect to the Alibaba Cloud destination. Make sure the target's configured source stream is connected to the Wowza Streaming Engine input. Errors might be due to an invalid target configuration or issue with the destination server.
The status of each stream target updates automatically if your Wowza Streaming Engine application has fewer than 100 stream targets. If your application has more than 100 stream targets, you can click Refresh to update the status.

Test the connection


Configure your encoder and then test the live stream.
 
  1. Start the stream in the H.264 camera or encoder that's sending the stream to the live application in Wowza Streaming Engine.

    The live application ingests the live stream and sends it to the Alibaba Cloud target.
     
  2. In Wowza Streaming Engine, verify that the stream is working by clicking Incoming Streams, and then clicking the stream name.

    The stream detail page displays the Status of the stream (Active) as well as details about connections, uptime, and throughput for the live stream.
     
  3. Verify that your Alibaba Cloud target is receiving, publishing, and distributing the stream as you've configured it to do. To do this, use the Live Streaming Address URLs provided in the Alibaba CDN Console:
     
    Note: If you're using authentication, repeat the steps in Configure token authentication to generate the Live Streaming Address URLs with authentication tokens.
    • For RTMP, copy and paste the following URL into a player like VLC and replace [your-domain], app-name, and video-name with the correct values:

      rtmp://[your-domain]/app-name/video-name
       
    • For Apple HLS, use the following format and replace [your-domain], app-name, and video-name with the correct values:

      http://wowzalivetest.cdnpe.com/app-name/video-name.m3u8
  4. Stop the stream in the source camera or encoder to end your test connection.

More resources



If you're having problems or want to discuss this article, post in our forum.