The objective of this Quick Start is to give you a step-by-step guide you can follow to get started broadcasting a live streaming event using Zencoder and Video Cloud.
After completing this Quick Start, you should be able to:
- Enable your Video Cloud account for live streaming
- Use Zencoder's Live Cloud Transcoding API to deliver adaptive bitrate streaming to multiple devices
- Create a live stream video using the Video Cloud Media API
- Configure Adobe Flash Media Live Encoder for a live event
- Generate the publishing code for a live event
- View/debug live stream information using the Zencoder UI
This Quick Start will help you broadcast a live event to different devices using the free Adobe Flash Media Live Encoder. For a list of all the options available from Brightcove for delivering live streaming video, see Delivering Live Streams.
Audience
Anyone using Video Cloud and Zencoder who wants to broadcast a live streaming event to different devices and is comfortable making POST requests to a REST API.
Prerequisites
- A Video Cloud Pro or Enterprise level account; if you don't have an account, you can sign up for a trial account here
- A Zencoder account (at least a Pay-as-you-go level account); if you don't have an account, you can sign up for a trial here
- Adobe Flash Live Media Encoder has been downloaded and installed
- The API call examples that will be used in this Quick Start have been downloaded
- This Quick Start uses cURL which is a command line tool to transfer data from or to a server using HTTP; cURL is installed natively on OS X, Windows users can download the cURL software here
Creating a simple live stream using Zencoder and Video Cloud
Request a Zencoder account
- You need to have a Zencoder account to complete this Quick Start. If you don't have a Zencoder account, you can sign up for a trial account here.
Enable your Video Cloud account for live streaming
Before you can conduct a live streaming event, you should contact Brightcove Support and let them know you would like your Video Cloud account enabled for live streaming. When your account is configured, you will receive an email with a set of credentials and configuration information to setup live streaming with Video Cloud.
- In a browser window, navigate to Submit a Support Request and request Akamai HD + Akamai HLS Live credentials for your account.
- When your request has been processed, you will receive an email with your credentials and configuration information. Note that it may take a day or two for support to process your request.
Note: Credentials for Akamai HD are provisioned geographically based on your encoder IP. If you plan on having an event in a new location, you should provide Brightcove Support with an external and pingable IP address for the encoder at the new location. By doing so, Akamai can re-provision the entry point at the closest possible location to reduce latency and risk of interruption by travelling over as little of the public internet as possible. Brightcove Support needs to know this well in advance as the change takes some time to propagate within Akamai's network. If the encoder is not yet at the location, that is fine, so long as there is an externally pingable IP address on the network to use.
Modify the pre-built create_video API call
- Use a text editor to edit the appropriate create_video API file.
- Mac users edit: create_video_API.txt
- Windows users edit: create_video_API_WIN.txt
These files are included in the API call examples download file.
- Replace BCTOKEN with your Video Cloud API write token.
To get your API write token, login to the Legacy Video Cloud Studio and select Account Settings> API Management. In the Manage column, there is a Copy button you can click to copy the token to the clipboard.
- Replace all occurrences of EVENTNAME with a name for your event. In this Quick Start we will use LiveEvent for the event name.
Note: It is a best practice to name live events using an Event_Angle_Bitrate naming convention.
- Event - name for the event
- Angle - value to identify the camera or camera angle being used
- Bitrate - should be the same as the bitrate that will be used in the live stream
The create_video API files are formatted to use this naming convention.
Note: Each live event should have a unique name.
- Replace all occurrences of EPCODE with the entrypoint number given to you by Brightcove Customer Support. The entrypoint is contained in the Primary Entrypoint URL of your Akamai HD credentials.
- Replace HLSCODE with the six digit code number given to you by Brightcove Support. The code is contained in the Storage URL of your Akamai HLS credentials.
- Replace ACCOUNTID with your Brightcove publisher ID.
Note: Your Publisher ID is displayed on the New Video Cloud Studio homepage under your name.
- Mac users: Copy the entire contents of this file to the clipboard. Open the Terminal application, paste the contents of the clipboard into Terminal and press enter.
Windows users: Save the changes made to the file. Open the Command Prompt and run the following command:
curl --data @create_video_API_WIN.txt http://api.brightcove.com/services/post
Note for Windows users: This command assumes that the curl.exe is either in your PATH or in the same directory as the create_video_API_WIN.txt file.
- Confirm that the API call returns a
result
value (this is the video ID of the remote asset that was just created inside Video Cloud). Theerror
value should be null.Mac Terminal applicationWindows Command Prompt - Login to Video Cloud Studio and confirm that a remote asset has been created for the live stream.
Create output streams using the Zencoder API
- Use a text editor to edit the appropriate Zencoder API file.
- Mac users edit: Zencoder_API_call.txt
- Windows users edit: Zencoder_API_call_WIN.txt
These files are included in the API call examples download file.
- Replace all occurrences of EVENTNAME with a name for your event. In step 6 of this Quick Start, we chose LiveEvent for the event name.
- Replace RTMPUSERNAME with the user name given to you by Brightcove Support. This is the user name for your live streaming (Akamai HD) account.
- Replace RTMPPASSWORD with the password given to you by Brightcove Support. This is the password for your live streaming (Akamai HD) account.
- Replace all occurrences of EPCODE with the entry point number given to you by Brightcove Support (see step 7).
- Replace all occurrences HLSCODE with the code number given to you by Brightcove Support (see step 8).
- Replace all occurrences of ACCOUNTID with your Brightcove publisher ID.
Note: Your Publisher ID is displayed on the New Video Cloud Studio homepage under your name.
- Mac users: Replace ZCAPIKEY with your Zencoder API key.
Windows users: Locate your Zencoder API key as it will be used on the command line
To get your Zencoder API key, login to your Zencoder account and select API on the page header. The API key is located in the Full Access API Keys section of the page.
- (Optional). If you are located outside of the United States, you may wish to add the
region
parameter to the API call so your job is processed in your region, improving performance. A complete list of regions is available in the Zencoder documentation. A modified Mac API call with theregion
parameter is shown below. - (Optional). You may wish to add the
reconnect_time
parameter to the API call to prevent Zencoder from killing your job if there is a connection problem with the encoder. By default, the reconnect_time is 30 seconds. You can read more about thereconnect_time
parameter in the Zencoder documentation. A modified Mac API call with thereconnect_time
parameter set to 60 seconds is shown below. - Mac users: Copy the entire contents of this file to the clipboard. Open the Terminal application, paste the contents of the clipboard into Terminal and press enter.
Windows users: Save the changes made to the file. Open the Command Prompt and run the following command:
curl --header "Zencoder-Api-Key: ZCAPIKEY"--data @Zencoder_API_call_WIN.txt --insecure https://app.zencoder.com/api/v2/jobs
Note for Windows users: Replace ZCAPIKEY with the value you noted from step 20.
- The command will return a
stream_name
andstream_url
. Below is the output from the Mac Terminal application.
Configure Adobe Flash Media Live Encoder
- Launch Adobe Flash Media Live Encoder.
- Configure the Video encoding options. Use the following guidelines when setting the rendition properties. Keep all other values at their default.
Note: For the best quality, we recommend configuring your encoder to output a 1280 x 720, 2000 Kbps stream.
- Device: Select the camera you are using for the live stream
- Format:H.264
- Frame Rate:30 fps
- Input Size:1280 x 720
- Bit Rate:2000 Kbps
- Output Size:1280 x 720
- Audio:
- Format:AAC
- Channels:Stereo
- Sample Rate:48000 Hz
- Bit Rate:128 Kbps
- Configure the encoding Output options. Use the following guidelines when setting the output properties. Keep all other values at their default.
- Stream to Flash Media Server: checked
- FMS URL: Use the
stream_url
value returned by the Zencoder API call (see step 24) - Backup URL: leave blank
- Stream: Use the
stream_name
value returned by the Zencoder API call (see step 24) - Save to File:"Check" if you want to save the contents of the live stream to a file
- Click the Connect button. Check the bottom left of the media encoder dialog to verify that you have connected.
- Click the Start button to start the live stream. Check the bottom left of the media encoder dialog to verify that you have connected.
Note: There will be a slight delay from the time you start streaming to when your renditions reach reach Akamai.
Generate the publishing code for the live stream
- Return to Video Cloud Studio and open the Media module.
- Check the box next to the live stream video asset.
- Click Publish.
- Select a Brightcove Player and then click the URL to test or copy the appropriate publishing code.
- When you are done with the live stream, return to the Flash Media Live Encoder dialog and click Stop to stop the encoder from streaming.
Note: These steps assume you are using the New Video Cloud Studio.
Troubleshooting live stream issues
The Zencoder UI can be used to view stream information and can be helpful when troubleshooting live stream errors. Brightcove Support is also available to help you troubleshoot live stream issues.
View live stream information using the Zencoder UI
- Login to your Zencoder account and select the Encoding tab.
- In the Encoding Jobs section of the page, select the All Jobs tab.
- Click the Job ID link for the job that has a Processing status to view the status for your live stream. If your job has Failed, click the job's ID to view more information about what caused the issue and for suggestions to resolve when available.
For further help
If you need further help getting your live event to work, Brightcove Support is available to help. You can submit a case here. To make sure you get the fastest response possible, below is a list of what support will need to solve the problem.
- The specific symptoms the stream is having. For example, does it not play at all or does it stutter or freeze?
- Whether this stream worked correctly in the past
- The entry point URL you are using in your encoder
- The stream name and Zencoder Job ID
- The encoding software and hardware are you using
- The URL to the player to which you have published the live event
- The video ID of your live asset in Video Cloud Studio
- The results of a trace-route from your encoder to the publishing point host