Skip to content

Troubleshooting a live stream

In addition to following the live stream troubleshooting steps in this guide, make sure that your video settings align with Cloudflare live stream recommendations. If you use OBS, you can also check these OBS-specific recommendations.

Buffering, freezing, and latency

If your live stream is buffering, freezing, experiencing latency issues, or having other similar issues, try these troubleshooting steps:

  1. In the Cloudflare dashboard, go to the Live inputs page.

    Go to Live inputs ↗
  2. For the live input in use, select the Metrics tab.

  3. Look at your Keyframe Interval chart.

    It should be a consistent flat line that stays between 2s and 8s. If you see an inconsistent or wavy line, or a line that is consistently below 2s or above 8s, adjust the keyframe interval (also called GOP size) in your software or service used to send the stream to Cloudflare. The exact steps for editing those settings will depend on your platform.

    • Start by setting the keyframe interval to 4s. If playback is stable but latency is still too high, lower it to 2s. If you are experiencing buffering or freezing in playback, increase it to 8s.

    • If the keyframe interval is "variable" or "automatic", change it to a specific number instead, like 4s.

    What is a keyframe interval?

    The keyframe interval (also called GOP size) is a measurement of how often keyframes are sent to Stream. A shorter keyframe interval requires more Internet bandwidth on the broadcast side, but can reduce glass-to-glass latency. A longer keyframe requires less Internet bandwidth and can reduce buffering and freezing, but can increase glass-to-glass latency.

  4. Select the Logs tab and check for errors. Refer to Error codes to identify the cause.

Encoder failing to connect or keeps disconnecting

If your encoder shows a connection error such as "Failed to connect to server" or repeatedly disconnects shortly after starting, try the following:

  • Verify that your RTMPS URL, stream key, and encoder software are copied correctly into your broadcasting software.

  • If the connection fails, check whether the live input is disabled or its broadcast keys have been rotated.

  • If you use Live Webhooks, check for a live_input.errored event. The webhook payload includes an error code that can help you troubleshoot the specific cause.

Connecting but the player says "Stream has not started yet"

If your encoder is connected and the dashboard shows a green Connected status with valid metrics, but the player preview says Stream has not started yet, try the following:

  • Wait thirty seconds. There is a brief delay between when your encoder connects and the stream becomes playable.

  • Restart the stream to clear any bad state from the initial connection.

  • Verify that your encoder is sending AAC audio. If it is not, set your encoder's settings to AAC explicitly.

  • Verify that your encoder is sending keyframes at a fixed interval between two and eight seconds. If the keyframe interval is set to variable or automatic, change it to a specific value such as four seconds. For more details, refer to the keyframe information in Buffering, freezing, and latency.

Error codes

Live input warnings and errors are communicated both in the Logs tab for your live input, the live_input.errored live webhook payload, and via GraphQL. The following codes are reported:

Fatal conditions that will block playback or recording completely:

  • ERR_UNSUPPORTED_VIDEO_CODEC – The input video codec is unsupported for the protocol used.
  • ERR_UNSUPPORTED_AUDIO_CODEC – The input audio codec is unsupported for the protocol used.
  • ERR_STORAGE_QUOTA_EXHAUSTED – The account storage quota has been exceeded. Delete older content or purchase additional storage.
  • ERR_MISSING_SUBSCRIPTION – Unauthorized to start a live stream. Check subscription or log into Dash for details.

Non-fatal errors that will negatively affect playback or recordings:

  • ERR_GOP_OUT_OF_RANGE – The input GOP size or keyframe interval is less than 2 seconds or greater than 8.
  • ERR_UNHEALTHY – The active broadcast cannot be processed for an unknown reason that is most often due to encoder misconfiguration. Confirm the broadcast follows required and recommended settings, then disconnect and reconnect to try again.
  • ERR_LIVE_INPUT_LLHLS_INCOMPATIBLE – The input is enabled for Low-Latency HLS and encountered a B-Frame, which are not supported in LL-HLS and may result in buffering or stuttering on playback.

The following example shows an error code in a live_input.errored webhook payload:

Example live_input.errored webhook payloadjson
{
  "name": "Live Webhook Test",
  "text": "Notification type: Stream Live Input\nInput ID: 2c28dd2cc444cb77578c4840b51e43a8\nEvent type: live_input.errored\nUpdated at: 2024-07-09T18:07:51.077371662Z\nError Code: ERR_GOP_OUT_OF_RANGE\nError Message: Input GOP size or keyframe interval is out of range.\nVideo Codec: \nAudio Codec: ",
  "data": {
    "notification_name": "Stream Live Input",
    "input_id": "eb222fcca08eeb1ae84c981ebe8aeeb6",
    "event_type": "live_input.errored",
    "updated_at": "2024-07-09T18:07:51.077371662Z",
    "live_input_errored": {
      "error": {
        "code": "ERR_GOP_OUT_OF_RANGE",
        "message": "Input GOP size or keyframe interval is out of range."
      },
      "video_codec": "",
      "audio_codec": ""
    }
  },
  "ts": 1720548474
}

Was this helpful?