-
Notifications
You must be signed in to change notification settings - Fork 977
Live Plugin
Before using the Live Plugin, ensure your server is configured correctly. Below is a structured guide to set up and integrate the Live Plugin effectively.
The Live Plugin requires an NGINX RTMP Server for handling live streams. Follow this tutorial to set it up. While other RTMP servers are supported, NGINX RTMP offers the best integration. For third-party RTMP servers, use the LiveLinks Plugin for compatibility.
Feature | Description |
---|---|
💰 Pay-Per-View (PPV) | Charge users for accessing live streams, enabling monetization of live events. Setup PPV. |
🔄 Restreaming | Broadcast your stream simultaneously to other platforms like YouTube or Facebook. Restream Guide. |
📼 Recording Live Streams | Save and store live broadcasts automatically for future viewing. Learn more. |
⚙️ Adaptive Bitrates | Dynamically adjust stream quality based on the viewer's bandwidth for optimal viewing experience. Setup Guide. |
🗓️ Livestream Playlists | Schedule video playlists to stream live, allowing for automated broadcasting. Details here. |
♻️ Rebroadcast Videos | Rebroadcast stored videos as live content, creating the effect of a live event for pre-recorded material. Rebroadcaster Guide. |
If NGINX RTMP is on the same server as AVideo, the default settings usually suffice. For custom setups or external servers, adjust these parameters:
-
🖥️ RTMP Server URL (
server
):rtmp://your-domain/live
-
🌐 HTML5 Player URL (
playerServer
):https://your-domain:8443/live
-
📊 Stats Page URL (
stats
):https://your-domain:8443/stat
-
🔁 Restreamer URL (
restreamerURL
):your-domain/plugin/Live/standAloneFiles/restreamer.json.php
-
🔧 Control URL (
controlURL
):your-domain/plugin/Live/standAloneFiles/control.json.php
-
🛠️ Control Server (
controlServer
):http://localhost:8080/
-
🌐 Use External Live Servers (
useLiveServers
):false
-
📂 HLS Path (
hls_path
):/HLS/live
-
⏪ Disable DVR (
disableDVR
):false
-
🖼️ Disable GIF Thumbnails (
disableGifThumbs
):false
-
📷 Disable Live Thumbnails (
disableLiveThumbs
):false
-
📜 Hide Live Streams on Video List (
doNotShowLiveOnVideosList
):false
-
🔒 Protect Live (
protectLive
):false
-
🔢 Limit Live Streams Shown (
limitLiveOnVideosList
):12
These configurations are required for protecting your live streams and managing live stream controls. Ensure they are included in your nginx.conf
file.
To secure your live streams, especially for Live PPV, you need the VideoHLS Plugin. This plugin encrypts and protects your streams, ensuring only authorized viewers have access.
Ensure your NGINX installation includes the http_auth_request_module. Use this build command:
sudo ./auto/configure --with-http_ssl_module --with-http_stub_status_module --with-http_auth_request_module --add-module=../nginx-rtmp-module --with-cc-opt="-Wimplicit-fallthrough=0"
-
RTMP Configuration (Inside
rtmp
Block):
rtmp {
server {
...
application live {
...
# HLS encryption settings
hls_keys on;
hls_fragments_per_key 20;
}
}
}
-
HTTP Configuration for Access Control (Inside
http
Block):
http {
server {
...
location /live {
...
location ~ \.key$ {
auth_request /auth_key_check;
add_header 'Content-Type' 'application/octet-stream';
add_header 'Cache-Control' 'no-cache';
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length';
}
}
location = /auth_key_check {
internal;
proxy_pass http://localhost/AVideo/plugin/Live/authorizeKeyAccess.php;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header User-Agent $http_user_agent;
}
}
}
-
/live
: Serves.m3u8
and.key
files, securing key files with authorization checks. -
/auth_key_check
: Validates key file access to ensure only authenticated users retrieve keys.
For detailed instructions on setting up PPV and further protecting live streams, see the PayPerView Live Plugin Guide.
The Control Module manages live stream controls such as starting and stopping recordings. This configuration is mandatory for proper management of live streams.
Ensure the following setup is included in your nginx.conf
:
http {
server {
location /control {
allow 127.0.0.1;
deny all;
rtmp_control all;
}
}
}
For further configuration details, refer to the Complete nginx.conf Example.
- Publish using mobile devices or RTMP software (e.g., OBS).
- Direct webcam publishing via the website interface is not supported. More Details.
- Save live streams automatically for future viewing. Learn More.
Here's the revised section for Bandwidth Estimates with a clear explanation:
This table helps you calculate how much bandwidth your server needs to handle a certain number of viewers at different video resolutions. It shows the amount of data (bandwidth) each viewer will use, helping you determine if your server can support your expected audience size.
For example, if you plan to stream in 1080p, each viewer will use 5 Mbps of bandwidth. If your server has a 100 Mbps internet connection, it can support up to 20 viewers simultaneously at that resolution. Similarly, if your server has a 1 Gbps connection, it can support up to 200 viewers. If you use a CDN like YPT CDN, the number of viewers is unlimited since the load is distributed.
Resolution | Bandwidth per Viewer | Max Viewers (100 Mbps Connection) | Max Viewers (1 Gbps Connection) | YPT CDN Users |
---|---|---|---|---|
1080p | 5 Mbps | 20 | 200 | unlimited |
720p | 2.5 Mbps | 40 | 400 | unlimited |
480p | 1 Mbps | 100 | 1000 | unlimited |
360p | 500 kbps | 200 | 2000 | unlimited |
240p | 300 kbps | 350 | 3500 | unlimited |
Note: These estimates are approximate and depend on the actual network conditions and server performance. This table is a guide to help you plan your streaming setup based on the expected number of viewers and available bandwidth.