How to stream to Facebook Live using Wowza Streaming Engine

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 Wowza Streaming Engine to Facebook Live.

This article explains how to set up Wowza Streaming Engine and Facebook so that you can send a single live stream to the Facebook Live network for distributed delivery. The process will be similar to what's documented here, but see Facebook's documentation if you need help with configuring its service to ingest live streams.

Notes:
  • Wowza Streaming Engine 4.5 or later and a Facebook account are required.
     
  • All Facebook accounts (personal profiles and commercial Pages) are supported.

Contents


Video tutorial: Configuring Wowza Streaming Engine to stream to Facebook Live
Requirements
Configure Facebook 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 Facebook Enable Stream Targets
Test the connection
About Facebook Live video posts
More resources

Video tutorial: Configuring Wowza Streaming Engine to stream to Facebook Live



Requirements


Facebook stream targets have the following requirements for live streams:
 
  • The maximum resolution is 720p (720 x 1280), at 30 frames per second.
     
  • You must send a keyframe (I-frame) at least once every two seconds throughout the stream.
     
  • The recommended maximum video bitrate is 4 Mbps.
  • The audio bitrate must be 128 Kbps mono.
  • The audio sample rate must be 44.1 KHz.
  • The maximum length is 4 hours.
Notes:
  • If your live stream exceeds the maximum length, Facebook terminates the post and saves the video. Wowza Streaming Engine automatically creates a new Facebook post with the same settings and continues the live stream.
     
  • Facebook may change their live stream requirements at any time. For more information, see their Live API Best Practices.
  • Facebook policy prohibits you from simultaneously streaming to Facebook Live and other online services. You can, however, broadcast to your Facebook page and your own website. For more information, see “Can I simulcast? ” in the Facebook Live API FAQ.

Configure Facebook to receive and distribute the stream


Before you start, make sure you have a Facebook account.

When your Facebook account is ready, create the Page, group, or event to which you want to post a live stream. If streaming to your Timeline, or to an existing Page, group, or event, no additional configuration is required; continue with Create an application in Wowza Streaming Engine to ingest the live source video.

To get a Facebook account or for help with live stream provisioning, contact Facebook support.

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


Create a live application in Wowza Streaming Engine that will receive the live stream from an H.264 encoder or camera and send it to Facebook for distributed delivery.
 
  1. Sign in to Wowza Streaming Engine 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
Notes:
  • Wowza Streaming Engine requires RTMP and RTSP sources to provide a username and password to connect to a live application. For information on how to turn off authentication, see Managing live source authentication settings.
     
  • To ensure that accurate chunk durations are produced, Facebook requires the source stream to be encoded with a maximum of two-second keyframe intervals.

Create a stream target to send the stream to Facebook


After you create the live application in Wowza Streaming Engine, do the following to configure it to send the stream to Facebook:

Note: If you're using an RTMP URL generated by the Facebook Live API to stream to Facebook, you must use a generic RTMP stream target rather than the Facebook Live stream target. When configuring the RTMP stream target, note that you must remove the  rtmp:// prefix from the URL provided by Facebook. For more information, see Create a stream target to send the stream to the RTMP destination.

You can also use the generic RTMP stream target to send a secure RTMP stream to Facebook if you configure the sendSSL property.

  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 Facebook Live. Wowza Streaming Engine sends the stream to Facebook Live securely over RTMPS whenever possible; otherwise, Facebook Live receives the stream over RTMP.
     
  3. On the Facebook Live Configuration page, enter 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. For clarity, we recommend including the bitrate in the Stream Target Name.
       
    • Source Stream Name - The name of the incoming stream that you specified in Wowza Streaming Engine when you set up the video source.
       
    • Title - A title for the live video to be displayed in your Facebook Live post.
       
    • Description - A description of the live video to be displayed in your Facebook Live post.
       
    • Continuous Live - Check the Send a continuous live stream check box if you want to send a stream of unlimited length to Facebook.
       
      Note: When a continuous live stream ends, the post is removed from Facebook. Continuous live streams aren't converted to VOD assets.
  4. Click Login to authorize your account as a Facebook Live target and grant permissions to Wowza Streaming Engine.

    When Facebook asks Wowza Streaming Engine would like to post to Facebook for you. Who should be able to see these posts?, choose the most public privacy level you will ever want to use. This is the App visibility and post audience setting, which is the default privacy level for posts from Wowza Streaming Engine and the most public privacy level you can use. For more information, see Facebook privacy settings

    Notes:
    • If you can't log in, open a new tab in your web browser, log in to your Facebook account, and then log out. Then return to the Wowza Streaming Engine Manager tab and click Login again within the Stream Target configuration.
       
    • Wowza Streaming Engine 4.5.0.02 and later saves the name of the Facebook account associated with the Stream Target. When you edit a Facebook stream target in Wowza Streaming Engine Manager, this is displayed as the Account Name. For stream targets created with Wowza Streaming Engine 4.5.0.01 and earlier, the Account Name displays Unavailable
  5. Select your Video Destination. The destination is where you want to post the live stream on Facebook.
     
    • My Timeline - Post to your Facebook Timeline. No additional Destination Options are required.
       
    • Page - Post to a Page you manage. Select the desired Page from My Pages. This can be the Page you're streaming to or the Page an event that you're streaming to is associated with. The Page's name can't contain less-than (<), greater-than (>), colon (:), quotation (' and "), forward slash (/), backslash (), pipe (|), question mark (?), asterisk (*), double-dot (..), or tilde (~) characters.
       
    • Group - Post to a group you manage. Select the desired group from My Groups. This can be the group you're streaming to or the group an event that you're streaming to is associated with.
       
    • Event - Post to an event you're hosting. Events are associated with a Timeline, Page, or group, so you must select the Event Source and, when applicable, select the Page or group on which the event was created. Then select the desired event from My Events.
    Note: If you want to share on a Page, group, or event that doesn't appear in the menus, you may not have permission to post to it. Check your Facebook account's settings.
  6. If your Video Destination is My Timeline, select the Privacy level of your video. The privacy level determines who can watch your live video on Facebook: just you (Only me), Friends, Friends of Friends, or all Facebook users (Public). Note that the App visibility and post audience is the default and most public privacy level you can use. See Facebook privacy settings.
     
  7. Click Add this target.

Facebook privacy settings

When you log into Facebook for the first time from Wowza Streaming Engine, you're asked to specify an App visibility and post audience setting. This is the default privacy level for your posts from Wowza Streaming Engine and is the most public privacy level you can use. If you set a post's privacy to a level that's more public than the App visibility and post audience setting, the App visibility and post audience privacy level will be used instead. To change the App visibility and post audience setting for future posts, do the following:

  1. Open Facebook in a new window, and log in.
  2. In the upper-right corner, click the down arrow, and then click Settings.
  3. In the left panel, click Apps and, under Logged in with Facebook, click Wowza Streaming Engine.
  4. Select the App visibility and post audience setting you want, and then click Save.

Enable Stream Targets


Before you stream, you must enable the Stream Targets feature for the Wowza Streaming Engine application and for the Facebook 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 isn't pushing the stream to the Facebook destination yet because it's waiting for the source stream to connect to the Wowza Streaming Engine instance.
     
  • Active. The Wowza Streaming Engine instance successfully connected to the Facebook destination and is actively pushing the stream.
     
    Notes:
    • The live video post is automatically published to the Facebook destination when the stream target's status becomes Active.
       
    • When logged into Facebook you, as the publisher of the live stream, may see the label Published with Wowza Streaming Engine in the post. This label isn't visible to viewers; it's only visible to the account used to publish the stream.
  • Error. The Wowza Streaming Engine instance tried to connect to the Facebook destination but was unsuccessful. Make sure that the target's configured source stream is connected to the Wowza Streaming Engine input and that the target is configured correctly.

    An error can also occur if the Facebook user access token in the target has expired. If this occurs, a statement similar to the following is recorded in the Wowza Streaming Engine error log file ([install-dir]/logs/wowzastreamingengine_error.log):
     
    2016-06-23 10:42:56 MDT comment server WARN 200 - PushPublishFacebookTokenInfo.log: token is invalid

    To fix this issue, edit the Facebook stream target in Wowza Streaming Engine Manager, log in to the appropriate Facebook account, and then save the stream target again.
     
    Note: To enable this error to be logged, you must enable the Debug Log option on the Advanced tab for the stream target in Wowza Streaming Engine Manager. To do this:
     
    1. Click the Edit icon for the stream target.
       
    2. On the Advanced tab, click Edit. Access to the Advanced tab is limited to administrators with advanced permissions. For more information, see Manage credentials.
       
    3. Set Debug Log to true, and then click Save.
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 Facebook.
     
  2. In Wowza Streaming Engine Manager, verify that the stream is working:
     
    • Click Incoming Streams in the contents panel and then click 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.
       
    • Click Stream Targets in the contents panel. The Status of the target should be Active.
  3. Verify that Facebook is receiving the stream. Check that the live video was posted to your Facebook destination.
     
  4. Stop the stream in the source camera or encoder to end your test connection.

About Facebook Live video posts


After the Facebook stream target initiates a live video post, the video post in Facebook is labeled LIVE. If the live source stream is disconnected, Facebook puts the video post into a "waiting" state. If the live stream is reconnected quickly, the video post resumes after a short recovery period.

However, if it takes more than a few minutes for the live source stream to reconnect, Facebook will automatically "close" the live video post and start converting it to an on-demand video file. If the live source stream then reconnects to the stream target, a new live video post is generated with the same Title, Description, Video Destination, and Privacy settings.

The following actions performed in Wowza Streaming Engine can also cause Facebook to close an active live video post and generate a new one for a Facebook stream target:
 
  • Restarting the media server, the virtual host (VHost), or the live application that has the Facebook stream target.
     
  • Disabling, deleting, restarting, or editing and saving the Facebook stream target

More resources



Originally Published: For Wowza Streaming Engine 4.5.0 on 06-23-2016.
Updated: For Wowza Streaming Engine 4.6.0.02 on 01-31-2017.
 

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