Stream to Facebook Live using Wowza Streaming Engine

The Stream Targets feature in Wowza Streaming Engine™ media server 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.
  • Effective May 1, 2019, Facebook requires all live video posts to use RTMPS. For instructions on sending an RTMPS stream to a destination such as Facebook Live, see Use RTMP to distribute live streams from Wowza Streaming Engine.

Video tutorial: Stream to Facebook Live


See how to stream to Facebook Live and other destinations.

Before you start


You should be aware of the following Facebook stream target requirements:

  • 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 source stream to ensure that accurate chunk durations are produced.
     
  • The recommended maximum video bitrate is 4 Mbps.
  • Audio is required (AAC only).
  • The audio bitrate must be 128 Kbps mono.
  • The audio sample rate must be 44.1 KHz.
  • The maximum length is 8 hours.
  • The recommended projection format for 360 (spherical) video is equirectangular.
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.

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 to which you want to post a live stream. If streaming to your Timeline, or to an existing Page, no additional configuration is required.

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

Create a stream target to send the stream to Facebook


After you create a Live application in Wowza Streaming Engine, complete the following steps 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. Also, on the Facebook website, you must click Go Live to publish the stream; the stream is in a preview state until Go Live is clicked. 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.
       
    • 360 Video Projection - The 360 (spherical) video projection format of your video. We recommend equirectangular; other formats may not work. If your stream isn't 360 video, select None
  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
    • Important: We recommend limiting the number of stream targets associated with a single account and used simultaneously to 10. If you need to create more than 10 Facebook stream targets for use simultaneously, use a different Facebook account.
  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. 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.
       
      Notes:
      • The My Pages list displays a maximum of 25 pages associated with the Facebook account.
      • If you want to share on a page 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 a Business integration 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 Business integration visibility and post audience setting, the Business integration visibility and post audience privacy level will be used instead. To change the Business integration 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 Business Integrations and, under Active Business Integrations, click Wowza Streaming Engine.
  4. Under Who can see you use this business integration, select the Business integration 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 or the individual stream target you created.

  1. In the contents panel of your application, if you don't see a checkmark next to Stream Targets, click Stream Targets in the contents panel and then click Enable Stream Targets.

    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.

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


     

  3. When prompted, click Restart Now so your change takes effect.

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 become invalid. This can happen if the token expires, when you change the password on the associated Facebook account, or if you manually remove permissions from the Wowza Streaming Engine application on Facebook. If the access token becomes invalid, 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 your application in Wowza Streaming Engine. The 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 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.

Troubleshoot a Facebook Live stream target 


If you encounter problems sending your live stream to Facebook, a timeout issue may be the cause. Increasing the timeout may fix it. 

  1. In Wowza Streaming Engine Manager, click the Applications tab and select your application in the contents panel.
  2. In the contents panel, click Stream Targets and then click on your Facebook stream target. 
  3. In the details page, click the Custom tab, and then click Edit.
  4. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:
    • Name - Enter facebook.readWriteTimeout.
    • Type - Select Integer.
    • Value - Enter 15000 milliseconds. (The default value is 6000 milliseconds.)
  5. Click Save, and then restart the application when prompted to apply the changes.

More resources