Live API Best Practices

It is important to note the following specs for Facebook's live video streaming product and API. This documentation will be actively updated to reflect developments of the product.

Technical Recommendations and Tips

  1. While it's possible to insert previously recorded video into a live stream, we highly recommend that you exclusively show live content during live videos. This ensures that live content remains live.

  2. Broadcast for longer periods of time to reach more people. The longer you broadcast, the more likely people are to discover and share your video with their friends on Facebook. We recommend that you go live for at least 10 minutes, though you can stay live for up to 4 hours.

  3. Tag your location! When you add your location to a live video, that gives a greater chance that you'll appear on the Facebook Live Map!

  4. For optimal security of your streams, we recommend using the RTMPS stream URL and key. This will encrypt your live stream.

  5. If you're streaming with the Live API, we recommend setting up a wired internet connection to ensure stability. Wireless internet connections will work but may drop streams due to poor network connectivity.

  6. If possible, we encourage the use of hardware encoders in lieu of online encoders that run through your machine or computer. This will help with stability and ensure that frames are pushed successfully to the Facebook Live endpoint.

Technical Specs

Video Format:

  • We accept video in maximum 720p (1280x720) resolution at 30 frames per second, with 1 key frame every 2 seconds.
  • You must send an I-frame (keyframe) at least once every two seconds throughout the stream.
  • Recommended max bit rate is 4 Mbps. Going above this maximum is possible but will make live streams highly unstable.
  • Changing resolution midstream has negative impact on the broadcast.
  • Titles must be less than 255 characters otherwise the stream will fail.
  • The Live API accepts H264 encoded video and AAC encoded audio only.

Video Length:

  • 4 hour maximum length for live stream.
  • 4 hour maximum length for preview streams (either through Live dialog or publisher tools). After 240 minutes, a new stream key must be generated.
  • RTMP stream URLs will expire 24 hours after they are created.

Advanced Audio Settings:

  • Audio Sample Rate: 48 KHz
  • Audio Bitrate: 128 Kbps mono
  • Audio Codec: AAC

Advanced Video Settings:

  • Pixel Aspect Ratio: Square
  • Frame Types: Progressive Scan
  • Bitrate Encoding: CBR
  • Video Codec: H264

Playback of live content will only work if the input broadcast has both an audio and a video track.

OBS Settings:

If you are using Open Broadcaster Software to stream live, the following tips will ensure the best quality live stream.

  • When putting the Facebook Live RTMP stream URL and key into OBS, go to Settings > Stream. Under 'Stream Type', select 'Custom Streaming Server'. Then break apart the server URL (rtmp:// and key. For more information, follow our Quick Start Guide.

Error Codes

Error messages will be sent via RTMP then will persist through to the Graph API. You can use the broadcast/video ID and query for the errors in the graph explorer via a GET request. Errors returned will contain the error code, description, and a timestamp.

error_subcode Error Summary Description


Live Video Not Deleted

There was a problem and we weren't able to delete your live video. Please try again.


Live Video Does Not Exist

The live video you are trying to access does not exist in the system any more.


Privacy Setting Required

You need to set a privacy before going live.


Generic Stream

There was an error during the stream


Editing Via Video API Is Not Allowed While Live

Editing a live video using the Video Edit API is not allowed. Use the live video ID.


Live Copyright Violation

Your live video has been stopped because it may contain audio or visual content that belongs to {pageName}.


Upload Problem

There was a problem and your video wasn't uploaded. Please try again.