Skip to content

What to do if your live does not play

Daniel Neto edited this page Nov 21, 2024 · 4 revisions

If you're having trouble with live stream playback, follow these simple steps to identify and fix common issues.


1. Is Nginx Running?

The Nginx RTMP server must be running for live streaming.

  1. Check if Nginx is running:

    ps aux | grep nginx
    • If you see Nginx processes, it's running.

    • If not, start it with:

      /usr/local/nginx/sbin/nginx
  2. Check the stats page:
    Open this URL in your browser:

    https://mysite.com:8443/stats
    

    Replace mysite.com with your domain. It should show active streams.

image


2. Check Nginx Error Logs

Error logs can reveal why the stream isn’t working.

  • View logs in real-time:

    tail -f /usr/local/nginx/logs/error.log

Watch for errors while starting your live stream.


3. Are HLS Files Being Created?

HLS files (.m3u8 and .ts) are needed for playback.

  1. Go to the HLS directory:

    cd /HLS/live/
    ls
  2. You should see .m3u8 (playlists) and .ts (video segments).
    If not, check your Nginx configuration or stream setup.


4. Check the Video URL

The video player depends on a valid URL to play the stream.

  1. Find the video tag in your HTML:

    <video ...>
        <source src="https://yourdomain.com/live/$name/index.m3u8" type="application/x-mpegURL">
    </video>
  2. Test the URL in your browser:
    Copy the URL (replace $name with your stream key) and open it in your browser.

    • If it starts with #EXTM3U, it’s working.
    • If it shows an error, there’s an issue with the stream.

5. Are Protocols Matching?

Your website and stream server must use the same protocol (HTTP or HTTPS).

  • Check your website:
    Open your site and see if the URL starts with http:// or https://.

  • Match protocols:
    If your site uses HTTPS, ensure Nginx is also configured for HTTPS. Update the Nginx configuration and restart it:

    /usr/local/nginx/sbin/nginx -s reload

6. Check the m3u8 File in Your Browser

You can use your browser’s developer tools to check the .m3u8 file.

  1. Open your website and press Ctrl + Shift + I (or Cmd + Option + I on Mac).
  2. Go to the Network tab and refresh the page.
  3. Type .m3u8 in the filter box.
  4. Check the file status:
    • 200 OK means the file is accessible.
    • Errors like 404 Not Found indicate a problem with the file path or stream.

image

For more details, see Using Your Browser Console to Diagnose JavaScript Errors.


7. Is Adaptive Streaming Enabled?

Adaptive streaming ensures viewers get the best stream quality based on their connection.

  1. Log in to your Avideo admin panel.
  2. Go to the Plugins section.
  3. Check if Adaptive Mode is enabled in the Live Plugin settings.

For more details, visit the Adaptive Bitrates on Livestream guide.

Clone this wiki locally