winshining / nginx-http-flv-module

A media streaming server based on nginx-rtmp-module. In addtion to the features nginx-rtmp-module provides, HTTP-FLV, GOP cache, VHosts (one IP for multi domain names) and JSON style statistics are supported now.
BSD 2-Clause "Simplified" License
2.72k stars 567 forks source link

How do you playback streams across multiple domains. #188

Closed TroyKomodo closed 3 years ago

TroyKomodo commented 3 years ago
server {
    listen 1935;
    server_name domain1.com
    application live {
        live on;
        allow play 127.0.0.1;
        deny play all;
    }
}

server {
    listen 1935;
    server_name domain2.com

    application live {
        live on;
        allow play 127.0.0.1;
        deny play all;
    }
}

if i stream to the first domain and do ffprobe rtmp://127.0.0.1/live/xxx the stream exists and i get data.

This is not the same for if i were to stream to the second domain.

winshining commented 3 years ago

Well, the server cannot match the different server blocks according to IPs but domain names. If you want to stream to the second domain and play from it, please use domain name in url rather than IP:

publish: ffmpeg -re -i media_file -c copy -f flv rtmp://domain2/live/xxx
play: ffplay rtmp://domain2/live/xxx
TroyKomodo commented 3 years ago

I c thanks <2