GithubHelp home page GithubHelp logo

srt-live-server's Introduction

Introduction

srt-live-server(SLS) is an open source live streaming server for low latency based on Secure Reliable Tranport(SRT). Normally, the latency of transport by SLS is less than 1 second in internet.

Requirements

please install the SRT first, refer to SRT(https://github.com/Haivision/srt) for system enviroment. SLS can only run on OS based on linux, such as mac, centos or ubuntu etc.

Compile

$ sudo make

bin file is generated in subdir of 'bin'.

Directivies

about the config file, please see the wiki: https://github.com/Edward-Wu/srt-live-server/wiki/Directives

Usage

$ cd bin

1.help information

$ ./sls -h

2.run with default config file

$ ./sls -c ../sls.conf

Test

SLS only supports the MPEG-TS format streaming.

1.test with ffmpeg

you can push camera live stream by FFMPEG.Please download ffmpeg sourcecode from https://github.com/FFmpeg/FFmpeg, then compile FFMPEG with --enable-libsrt.

srt library is installed in folder /usr/local/lib64. if "ERROR: srt >= 1.3.0 not found using pkg-config" occured when compiling FFMPEG, please check the ffbuild/config.log file and follow its instruction to resolve this issue. in most cases it can be resolved by the following command: export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig

if "error while loading shared libraries: libsrt.so.1" occured, please add srt library path to file '/etc/ld.so.conf' as the default path, then refresh by comand /sbin/ldconfig with root.

use ffmpeg to push camera stream with SRT(on my mac):

$ ./ffmpeg -f avfoundation -framerate 30 -i "0:0" -vcodec libx264 -preset ultrafast -tune zerolatency -flags2 local_header -acodec libmp3lame -g 30 -pkt_size 1316 -flush_packets 0 -f mpegts "srt://[your.sls.ip]:8080?streamid=uplive.sls.com/live/test"

play the SRT stream with ffplay:

./ffplay -fflags nobuffer -i "srt://[your.sls.ip]:8080?streamid=live.sls.com/live/test"

2.test with OBS

the OBS supports srt protocol to publish stream when version is later than v25.0. you can use the following url: srt://[your.sls.ip]:8080?streamid=uplive.sls.com/live/test whith custom service.

3.test with srt-live-client

there is a test tool in sls, which can be used performance test because of no codec overhead but main network overhead. the slc can play a srt stream to a ts file, or push a ts file to a srt stream.

push ts file as srt url:

cd bin

./slc -r srt://[your.sls.ip]:8080?streamid=uplive.sls.com/live/test -i [the full file name of exist ts file]

play srt url

./slc -r srt://[your.sls.ip]:8080?streamid=live.sls.com/live/test -o [the full file name of ts file to save]

4.use sls with docker

please refer to :https://hub.docker.com/r/ravenium/srt-live-server

Note:

1.SLS refer to the RTMP url format(domain/app/stream_name), example: www.sls.com/live/test. The url of SLS must be set in streamid parameter of SRT, which will be the unique identification a stream.

2.How to distinguish the publisher and player of the same stream? In conf file, you can set parameters of domain_player/domain_publisher and app_player/app_publisher to resolve it. Importantly, the two combination strings of domain_publisher/app_publisher and domain_player/app_player must not be equal in the same server block.

3.I supply a simple android app for test sls, your can download from https://github.com/Edward-Wu/liteplayer-srt

ReleaseNote

v1.2

  1. update the memory mode, in v1.1 which is publisher copy data to eacc player, in v1.2 each publisher put data to a array and all players read data from this array.
  2. update the relation of the publisher and player, the player is not a member of publisher. the only relation of them is array data.
  3. add push and pull features, support all and hash mode for push, support loop and hash for pull. in cluster mode, you can push a stream to a hash node, and pull this stream from the same hash node.

v1.2.1

  1. support hostname:port/app in upstreams of pull and push.

v1.3

  1. support reload.
  2. add idle_streams_timeout feature for relay.
  3. change license type from gpl to mit.

v1.4

  1. add http statistic info.
  2. add http event notification, on_connect, on_close.
  3. add player feature to slc(srt-live-client) tool for pressure test.

v1.4.1

  1. add publisher feather to slc(srt-live-client) tool, which can push ts file with srt according dts.
  2. modify the http bug when host is not available.

v1.4.2

  1. add remote_ip and remote_port to on_event_url which can be as the unique identification for player or publisher.

v1.4.3

  1. change the tcp'epoll mode to select mode for compatible MAC os.
  2. modify the http check repeat bug for reopen.

v1.4.4

  1. OBS streaming compatible, OBS support the srt protocol which is later than v25.0. (https://obsproject.com/forum/threads/obs-studio-25-0-release-candidate.116067/)

v1.4.5

  1. add hls record feature.

v1.4.6

  1. update the pid file path from "~/" to "/opt/soft/sls/"

v1.4.7

  1. update the pid file path from to "/opt/soft/sls/" "/tmp/sls" to avoid the root authority in some case.

v1.4.8

  1. compatible for srt v1.4.1, add the set latency method before setup method

v1.4.9

  1. compatible for raspberrypi.

srt-live-server's People

Contributors

edward-wu avatar ischluff avatar lance-lmwang avatar sclem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

srt-live-server's Issues

Predefined stream name

In the config file, can we predefined the stream name ( srt://domain/live/stream_name ) ?

SRT app publisher vs. domain publisher

Hi Edward,
First of all, thanks for your work on this.
I am trying unsuccessfully to receive an SRT stream using OBS as a stream source.
The server starts up just fine, and I am able to establish a connection using obs with stream settings: srt://192.168.86.24:8080?streamid=live.sls.com/live/test however, a failure is experienced shortly after connection with contents:
2020-04-17 12:52:42:638 SLS INFO: [0x7f9398000000]CSLSListener::handler, m_map_puller->add_relay_manager failed, new role[192.168.86.24:63550], stream='uplive.sls.com/live/test', publisher is NULL, no puller_manager.
Clearly, the server appears to be looking for a domain publisher "uplive.sls.com/live/test" - I am not sure what the distinction is between the two publisher URL types. Could you provide some assistance? I have no relay currently set up. I just want to receive the stream as step one.

I am reading through the source code but there is no help to be found so I am reaching out to you. Thank you in advance. I will copy and paste my logs and configuration below.

Fail log:

    
2020-04-17 12:52:39:375 SLS INFO: sls_conf_open, parsing conf file='sls.conf'.
write pid ok, file='~/sls/pid.txt', pid=11639.
2020-04-17 12:52:39:376 SLS INFO: 
srt live server is running...
set log level='DEBUG'.
2020-04-17 12:52:39:376 SLS INFO: [0x7f93a0600130]CSLSManager::start, new m_list_role=0x7f93a06003f0.
2020-04-17 12:52:39:377 SLS INFO: [0x7f9398000000]CSLSListener::start...
2020-04-17 12:52:39:377 SLS INFO: [0x7f9398000000]CSLSListener::init_conf_app, m_back_log=100, m_idle_streams_timeout=10.
2020-04-17 12:52:39:377 SLS INFO: [0x7f9398000000]CSLSListener::init_conf_app, add app push 'uplive.sls.com/live'.
2020-04-17 12:52:39:377 SLS INFO: [0x7f9398000000]CSLSListener::init_conf_app, add app live='live.sls.com/live', app push='uplive.sls.com/live'.
2020-04-17 12:52:39:377 SLS INFO: [0x7f9398000000]CSLSListener::init_conf_app, add app live='live-1.sls.com/live', app push='uplive.sls.com/live'.
2020-04-17 12:52:39:377 SLS INFO: [0x7f93a1803a00]CSLSSrt::libsrt_setup, fd=504229590.
2020-04-17 12:52:39:377 SLS INFO: [0x7f9398000000]CSLSListener::start, libsrt_setup ok.
2020-04-17 12:52:39:377 SLS INFO: [0x7f93a1803a00]CSLSSrt::libsrt_listen, ok, fd=504229590, at port=8080.
2020-04-17 12:52:39:377 SLS INFO: [0x7f9398000000]CSLSListener::start, m_list_role=0x7f93a06003f0.
2020-04-17 12:52:39:377 SLS INFO: [0x7f9398000000]CSLSListener::start, push to m_list_role=0x7f93a06003f0.
2020-04-17 12:52:39:377 SLS INFO: [0x7f93a0600130]CSLSManager::start, init listeners, count=1.
2020-04-17 12:52:39:377 SLS INFO: [0x7f9390809200]CSLSGroup::start, worker_number=0.
2020-04-17 12:52:39:377 SLS INFO: [0x7f9390809200]CSLSThread::start, pthread_create ok, m_th_id=123145489854464.
2020-04-17 12:52:39:377 SLS INFO: [0x7f93a0600130]CSLSManager::start, init worker, count=1.
2020-04-17 12:52:39:377 SLS INFO: [0x7f9390809200]CSLSEpollThread::work, begin th_id=123145489854464.
2020-04-17 12:52:39:388 SLS INFO: [0x7f9398000000]CSLSRole::add_to_epoll, listener, sock=504229590, m_is_write=0, ret=0.
2020-04-17 12:52:39:388 SLS INFO: [0x7f9390809200]CSLSGroup::check_new_role, worker_number=0, listener=0x7f9398000000, add_to_epoll fd=504229590, role_map.size=1.
2020-04-17 12:52:42:638 SLS INFO: [0x7f93a1803a00]CSLSSrt::libsrt_accept ok, new sock=504229589, 192.168.86.24:63550.
2020-04-17 12:52:42:638 SLS INFO: [0x7f9398000000]CSLSListener::handler, new client[192.168.86.24:63550], fd=504229589.
2020-04-17 12:52:42:638 SLS INFO: [0x7f9398000000]CSLSListener::handler, [192.168.86.24:63550], sid 'live.sls.com/live/test'
2020-04-17 12:52:42:638 SLS INFO: [0x7f93a06004d8]CSLSMapRelay::add_relay_manager, no relay conf info, app_uplive=uplive.sls.com/live, stream_name=test.
2020-04-17 12:52:42:638 SLS INFO: [0x7f9398000000]CSLSListener::handler, m_map_puller->add_relay_manager failed, new role[192.168.86.24:63550], stream='uplive.sls.com/live/test', publisher is NULL, no puller_manager.
2020-04-17 12:52:42:638 SLS INFO: [0x7f93a0800000]CSLSSrt::libsrt_close, fd=504229589.
2020-04-17 12:52:58:312 SLS INFO: [0x7f93a1803a00]CSLSSrt::libsrt_accept ok, new sock=504229588, 192.168.86.24:50620.
2020-04-17 12:52:58:312 SLS INFO: [0x7f9398000000]CSLSListener::handler, new client[192.168.86.24:50620], fd=504229588.
2020-04-17 12:52:58:312 SLS INFO: [0x7f9398000000]CSLSListener::handler, [192.168.86.24:50620], sid 'live.sls.com/live/test'
2020-04-17 12:52:58:312 SLS INFO: [0x7f93a06004d8]CSLSMapRelay::add_relay_manager, no relay conf info, app_uplive=uplive.sls.com/live, stream_name=test.
2020-04-17 12:52:58:312 SLS INFO: [0x7f9398000000]CSLSListener::handler, m_map_puller->add_relay_manager failed, new role[192.168.86.24:50620], stream='uplive.sls.com/live/test', publisher is NULL, no puller_manager.
2020-04-17 12:52:58:312 SLS INFO: [0x7f9371005400]CSLSSrt::libsrt_close, fd=504229588.

Config:

srt {                #SRT
    worker_threads  1;
    worker_connections 300 ;

    log_file logs/error.log ;
    log_level debug;

    #stat_post_url http://192.168.31.106:8001/sls/stat;
    #stat_post_interval  5;#s

    record_hls_path_prefix /tmp/mov/sls;
    #vod  file name: /tmp/mov/sls/$listen/$domain_publisher/$app_publisher/$stream_name/vod.m3u8

    server {
        listen 8080;
        latency 20; #ms

        domain_player live.sls.com live-1.sls.com;
        domain_publisher uplive.sls.com;
        backlog 100; #accept connections at the same time
        idle_streams_timeout 10;#s -1: unlimited
        #on_event_url http://192.168.31.106:8000/sls/on_event; #?method=on_connect|on_close&role_name=&srt_url=%s
        app {
            app_player live ;
            app_publisher live ;

            record_hls off;#on, off
            record_hls_segment_duration 10; #unit s

            #relay {
            #    type pull;
            #    mode loop;#loop; hash;
            #    reconnect_interval 10;
            #    idle_streams_timeout -1;#s -1: unlimited
            #    upstreams 127.0.0.1:9090?streamid=live.sls.com/live 192.168.1.100:8080/?streamid=live.test.com/live;
            #}
            #relay {
            #    type push;
            #    mode all; #all; hash
            #    reconnect_interval 10;
            #    idle_streams_timeout 10;#s -1: unlimited
            #    upstreams 192.168.86.24:8081?streamid=uplive.sls.com/live ;
            #}
        }
    }
}```

play with vlc

while i play the stream with vlc, url is srt://192.168.137.225:8080?streamid=live.test.com/live/test.but it doesn't work.the log is:

2020-03-10 13:17:25:407 SLS INFO: [0x1dc4a80]CSLSSrt::libsrt_accept ok, new sock=194896598, 192.168.137.1:49521.
2020-03-10 13:17:25:407 SLS INFO: [0x7f593db87010]CSLSListener::handler, new client[192.168.137.1:49521], fd=194896598.
2020-03-10 13:17:25:407 SLS ERROR: [0x7f5934003480]CSLSSrt::libsrt_split_sid, sid='' is not as host/app/name.
2020-03-10 13:17:25:407 SLS ERROR: [0x7f593db87010]CSLSListener::handler, [192.168.137.1:49521], parse sid='' failed.

it seems that the sls can't get the parameter. can the vlc play the srt stream?

ffplay error

my ffplay command: ./ffplay -i "srt://127.0.0.1:8080?streamid=uplive.sls.com/live/test", get following error.
2020-03-11 16:36:39:957 SLS INFO: [0x7f8028805000]CSLSSrt::libsrt_accept ok, new sock=846006866, 127.0.0.1:54861.
2020-03-11 16:36:39:957 SLS INFO: [0x10c282000]CSLSListener::handler, new client[127.0.0.1:54861], fd=846006866.
2020-03-11 16:36:39:957 SLS INFO: [0x10c282000]CSLSListener::handler, [127.0.0.1:54861], sid 'uplive.sls.com/live/test'
2020-03-11 16:36:39:957 SLS ERROR: [0x10c282000]CSLSListener::handler, refused, new role[127.0.0.1:54861], stream='uplive.sls.com/live/test',but publisher=0x10c360000 is not NULL.
2020-03-11 16:36:39:957 SLS INFO: [0x7f8029007a00]CSLSSrt::libsrt_close, fd=846006866.

SRT options

How we can configure SRT options eg: passphrase, oheadbw ?

Haivision SRT player "Play Pro" not capable of streamid

Hi,
The Haivision Play Pro player is not capable of doing "?streamid" in the URLs.
It would be cool to use their mobile player to connect to SLS.

Is there some known work-around for this, to get this to work anyway?

URL in Play Pro not accepted
srt://192.168.178.24:8081?streamid=live.sls.com/live/test
~~
2020-04-04 13:03:59:112 SLS ERROR: [0x7fc168808c00]CSLSSrt::libsrt_split_sid, sid='' is not as host/app/name.
2020-04-04 13:03:59:112 SLS ERROR: [0x102ade000]CSLSListener::handler, [192.168.178.23:63903], parse sid='' failed.
~~

Docker

srt-live-server in docker no run for raspberrypi3, what is the problem for no run, tk

To pull from "ffmpeg" (exec a process) only when a connection is done.

I just want to transcode from x264 to x265 and send it through srt. The problem is that x265 es really hard performant so I can't have a couple of videos sending to srt when there's noone connected and pulling the video.

In nginx rtmp module there are options to run a process when a connection is received, passing the stream ID as an argument. Is there a chance to add this option here? So I can run ffmpeg only when a new connection is done (and kill it when the connection is finished), to save CPU cycles.

Cannot start successfully using supervisor

Hi Edward,
I can start the sls successfully in foreground. Now I want to use supervisor to start and monitor it like below:
[program:sls]
directory = /home/times/tools/srt-live-server/
command = /home/times/tools/srt-live-server/bin/sls -c ./sls.conf

But looks like the start just hang somewhere and I cannot see any log in logs/error.log.
Could you help on this? Thanks very much!

Make error 1

is there something i have done wrong when installing srt?
image

Can't start the server: failed to set option SRTO_LATENCY on socket

When I want to start the server I get this ERROR (every configuration and every other thing is default and no customization applied):
2020-06-12 04:53:23:688 SLS ERROR: [0x5653e6ed6e40]CSLSSrt::libsrt_setsockopt, failed to set option SRTO_LATENCY on socket: Operation not supported: Cannot do this operation on a BOUND socket

and this is the full log:
srt-server.log

"Fatal error: srt/srt.h: No such file or directory"

Srt is installed under /usr/local/srt. What am I doing wrong when trying to make?
Should I be cloning sls into the srt folder or something? Sorry for stupid question.

g++ -c -g slscore/SLSLog.cpp -o obj/SLSLog.o 
In file included from slscore/SLSLog.hpp:32,
                 from slscore/SLSLog.cpp:31:
slscore/common.hpp:120:1: warning: ‘typedef’ was ignored in this declaration
  120 | typedef struct ts_info {
      | ^~~~~~~
slscore/SLSLog.cpp: In constructor ‘CSLSLog::CSLSLog()’:
slscore/SLSLog.cpp:40:27: warning: zero-length gnu_printf format string [-Wformat-zero-length]
   40 |     sprintf(log_filename, "");
      |                           ^~
slscore/SLSLog.cpp: In member function ‘void CSLSLog::print_log(int, const char*, __va_list_tag*)’:
slscore/SLSLog.cpp:84:45: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
   84 |     sls_gettime_fmt(cur_time, cur_time_sec, "%Y-%m-%d %H:%M:%S");
      |                                             ^~~~~~~~~~~~~~~~~~~
slscore/SLSLog.cpp:87:30: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘int64_t’ {aka ‘long int’} [-Wformat=]
   87 |     sprintf(buf_info, "%s:%03d %s %s: %s\n" , cur_time, cur_time_msec, APP_NAME, LOG_LEVEL_NAME[level], buf);
      |                           ~~~^                          ~~~~~~~~~~~~~
      |                              |                          |
      |                              int                        int64_t {aka long int}
      |                           %03ld
slscore/SLSLog.cpp:88:12: warning: format not a string literal and no format arguments [-Wformat-security]
   88 |     printf(buf_info);
      |            ^~~~~~~~
slscore/SLSLog.cpp: In static member function ‘static void CSLSLog::set_log_level(char*)’:
slscore/SLSLog.cpp:105:20: warning: too many arguments for format [-Wformat-extra-args]
  105 |             printf("set log level='%s'.\n" , level, LOG_LEVEL_NAME[i]);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~
slscore/SLSLog.cpp: In member function ‘void CSLSLog::print_log(int, const char*, __va_list_tag*)’:
slscore/SLSLog.cpp:87:39: warning: ‘%s’ directive writing up to 4095 bytes into a region of size between 4054 and 4085 [-Wformat-overflow=]
   87 |     sprintf(buf_info, "%s:%03d %s %s: %s\n" , cur_time, cur_time_msec, APP_NAME, LOG_LEVEL_NAME[level], buf);
      |                                       ^~                                                                ~~~
slscore/SLSLog.cpp:87:12: note: ‘sprintf’ output 13 or more bytes (assuming 4139) into a destination of size 4096
   87 |     sprintf(buf_info, "%s:%03d %s %s: %s\n" , cur_time, cur_time_msec, APP_NAME, LOG_LEVEL_NAME[level], buf);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
g++ -c -g slscore/common.cpp -o obj/common.o 
In file included from slscore/common.cpp:48:
slscore/common.hpp:120:1: warning: ‘typedef’ was ignored in this declaration
  120 | typedef struct ts_info {
      | ^~~~~~~
slscore/common.cpp: In function ‘void sls_gettime_default_string(char*)’:
slscore/common.cpp:102:45: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  102 |     sls_gettime_fmt(cur_time, cur_time_sec, "%Y-%m-%d %H:%M:%S");
      |                                             ^~~~~~~~~~~~~~~~~~~
slscore/common.cpp: In function ‘int sls_send_cmd(const char*)’:
slscore/common.cpp:400:13: warning: too many arguments for format [-Wformat-extra-args]
  400 |      printf("sls_send_cmd failed, pid is invalid.\n", pid);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
g++ -c -g slscore/conf.cpp -o obj/conf.o 
In file included from slscore/conf.cpp:33:
slscore/common.hpp:120:1: warning: ‘typedef’ was ignored in this declaration
  120 | typedef struct ts_info {
      | ^~~~~~~
slscore/conf.cpp:38:36: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
   38 | sls_conf_base_t  sls_first_conf = {"", NULL, NULL} ;
      |                                    ^~
g++ -c -g slscore/SLSThread.cpp -o obj/SLSThread.o 
In file included from slscore/SLSLog.hpp:32,
                 from slscore/SLSThread.cpp:31:
slscore/common.hpp:120:1: warning: ‘typedef’ was ignored in this declaration
  120 | typedef struct ts_info {
      | ^~~~~~~
g++ -c -g slscore/SLSEpollThread.cpp -o obj/SLSEpollThread.o 
In file included from slscore/SLSEpollThread.cpp:30:
slscore/SLSEpollThread.hpp:29:10: fatal error: srt/srt.h: No such file or directory
   29 | #include <srt/srt.h>
      |          ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:61: obj/SLSEpollThread.o] Error 1

Remove streamid

Due to problems in vlc is there a way to create a broadcast without a streamid?
For example, if this parameter is not set create localhost:8080/live.

PID File hardcoded to nonexistent path

Hello,

Just dropped in to mention that the pid file is hardcoded to '~/sls/pid.txt'. It works when run, but it makes a literal path of "~" in the directory from which it is run.

error while loading shared libraries: libsrt.so.1

I've tried setting up srt-live-server on Ubuntu 18.04.3 and, while the build was successful, running the server results in the following error:

./sls: error while loading shared libraries: libsrt.so.1: cannot open shared object file: No such file or directory

I used the following commands to build srt and srt-live-server:

git clone -b v1.4.1 https://github.com/Haivision/srt.git
cd srt
./configure
make
sudo make install
cd ..
git clone -b v1.4.4 https://github.com/Edward-Wu/srt-live-server.git
cd srt-live-server
make

If there's anything I'm missing then please let me know.

cant play stream

i got it compiled on centos, when i try to connect to the stream in vlc, in the server console i get this

2020-03-29 16:08:46:174 SLS INFO: [0x23bfa80]CSLSSrt::libsrt_accept ok, new sock=451120864, 93.183.156.225:62094.
2020-03-29 16:08:46:174 SLS INFO: [0x7f23e5e00010]CSLSListener::handler, new client[93.183.156.225:62094], fd=451120864.
2020-03-29 16:08:46:174 SLS ERROR: [0x7f23dc0023e0]CSLSSrt::libsrt_split_sid, sid='' is not as host/app/name.
2020-03-29 16:08:46:174 SLS ERROR: [0x7f23e5e00010]CSLSListener::handler, [93.183.156.225:62094], parse sid='' failed.
2020-03-29 16:08:46:174 SLS INFO: [0x7f23dc0023e0]CSLSSrt::libsrt_close, fd=451120864.

over and over again

i am using the default config, port 8080 is the only one open

OBS connects and seems to be fine

OBS:
Screenshot_3

vlc-4.0.0-20200329-0836-dev-win64:
Screenshot_4

dont worry about the ip, i will burn the server later

why sls throw out "CSLSRole::invalid_srt, close sock="

I run sls in aliyun,and I push the udp stream in local ubuntu 16.04 by ffmpeg,the command line is below:
./ffmpeg -fflags nobuffer -i udp://239.1.1.1:1234?localaddr=192.168.100.127 -c copy -f mpegts srt://47.100.240.240:8088?streamid=uplive.vimsvideo.com/live/test

and then the sls server print out the line: CSLSRole::invalid_srt, close sock=550584168 , then ffmpeg client stop .....

I don't know whether it is about the conf in sls.conf. my conf file is :

srt { #SRT^Z^Z
worker_threads 2;

        log_file logs/error.log ;
        log_level info;

        worker_connections 300 ;
  server {
listen 8088;
        latency 20; #ms

domain_player live.vimsvideo.com live-1.vimsvideo.com;
domain_publisher uplive.vimsvideo.com;
backlog 100; #accept connections at the same time
app {
    app_player live ;
    app_publisher live ;
}

}
}
sorry for the low level question,I am the newer of srt and live server.
I hope to delive many UDP streams by a low latency way .

resolve hostnames for on_event_url

This project is great, awesome work. Reminds me of nginx.

Would you be willing to add support for gethostbyname (or similar) to resolve ips to dns names? Specifically I am running the server in docker and would like to use an event url with a hostname so I can load balance it. If you are too busy I would be willing to do it and submit a pr.

VLC Streamid

Hi sorry for opening ths again.

I have gone trough the major hassle and compiled my own version of VLC(windows) with the srt patch in the link applied.

Im still having the same trouble as without the patch, it does not pass the stream id, stills
seems to be empty. Same errors as mentioned in previous questions regarding VLC.

trying to play url srt://192.168.1.14:8080?streamid=live.test.com/live/test.

Any ideas?

"the vlc with srt is not available, because of not parsing streamid parameter.
if you want use vlc for srt , please refer to the following :

https://github.com/Edward-Wu/vlc-srt

this is a patch for vlc 3.0 to play with srt."

/usr/bin/ld: cannot find -lz

cloned srt built srt sudo make install srt
cloned srt-live-server
ubuntu 18 make returns:
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:51: recipe for target 'all' failed
make: *** [all] Error 1

纯小白编译出问题

我是做游戏转播方面的,平时有推流,爱折腾玩。。我目前按SRT的 编译好haivision的东西。。在编译这边的时候 出现错误。 我把srt的core复制sls的core里面 解决了第一次报错的问题。。现在有出现下面的问题,
image
大神可以出个详细的编译安装教程么。。我是纯小白 只能照葫芦画瓢,用的是ubuntu18。

open sls socket err

2020-06-29 11:15:23:135 SLS INFO: [0x9e19c0]CSLSManager::start, new m_list_role=0x9e01b0.
2020-06-29 11:15:23:135 SLS INFO: [0x7f931e541010]CSLSListener::start...
2020-06-29 11:15:23:135 SLS INFO: [0x7f931e541010]CSLSListener::init_conf_app, m_back_log=100, m_idle_streams_timeout=10.
2020-06-29 11:15:23:135 SLS INFO: [0x7f931e541010]CSLSListener::init_conf_app, add app push 'uplive.sls.com/live'.
2020-06-29 11:15:23:135 SLS INFO: [0x7f931e541010]CSLSListener::init_conf_app, add app live='live.sls.com/live', app push='uplive.sls.com/live'.
2020-06-29 11:15:23:135 SLS INFO: [0x7f931e541010]CSLSListener::init_conf_app, add app live='live-1.sls.com/live', app push='uplive.sls.com/live'.
2020-06-29 11:15:23:135 SLS INFO: [0x9dca60]CSLSSrt::libsrt_setup, fd=208459879.
2020-06-29 11:15:23:135 SLS INFO: [0x7f931e541010]CSLSListener::start, libsrt_setup ok.
2020-06-29 11:15:23:135 SLS ERROR: [0x9dca60]CSLSSrt::libsrt_setsockopt, failed to set option SRTO_LATENCY on socket: Operation not supported: Cannot do this operation on a BOUND socket

2020-06-29 11:15:23:135 SLS INFO: [0x7f931e541010]CSLSListener::start, libsrt_setsockopt latency=20 failure.
2020-06-29 11:15:23:135 SLS INFO: [0x9e19c0]CSLSManager::start, p->start failed.
2020-06-29 11:15:23:135 SLS INFO: sls_manager->start failed, EXIT!
2020-06-29 11:15:23:135 SLS INFO: exit, stop srt live server...
2020-06-29 11:15:23:135 SLS INFO: [0x9e19c0]CSLSManager::stop.
2020-06-29 11:15:23:135 SLS INFO: [0x9dc7f8]CSLSMapPublisher::clear.
2020-06-29 11:15:23:135 SLS INFO: [0x9dc8e8]CSLSMapRelay::clear.
2020-06-29 11:15:23:135 SLS INFO: [0x9dc9a8]CSLSMapRelay::clear.
2020-06-29 11:15:23:135 SLS INFO: [0x9e19c0]CSLSManager::stop, release rolelist, size=0.
2020-06-29 11:15:23:135 SLS INFO: exit, release sls_manager ok.
2020-06-29 11:15:23:135 SLS INFO: exit, release reload_manager_list begin,count=0.
2020-06-29 11:15:23:135 SLS INFO: exit, release reload_manager_list ok.
2020-06-29 11:15:23:135 SLS INFO: exit, release http_stat_client.
2020-06-29 11:15:23:135 SLS INFO: exit, uninit srt .
2020-06-29 11:15:23:137 SLS INFO: exit, close conf.
2020-06-29 11:15:23:137 SLS INFO: exit, bye bye!

i don't know why i got this? socket err

can't compile - Error 1 - error: ‘srt_epoll_set’

Hi, have installed srt 1.3.2 (64bit) and getting this error while compiling with gcc 9.2.0:

# make

g++ -c -g slscore/SLSLog.cpp -o obj/SLSLog.o 
In file included from slscore/SLSLog.hpp:32,
                 from slscore/SLSLog.cpp:31:
slscore/common.hpp:120:1: warning: ‘typedef’ was ignored in this declaration
  120 | typedef struct ts_info {
      | ^~~~~~~
slscore/SLSLog.cpp: In member function ‘void CSLSLog::print_log(int, const char*, __va_list_tag*)’:
slscore/SLSLog.cpp:84:45: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
   84 |     sls_gettime_fmt(cur_time, cur_time_sec, "%Y-%m-%d %H:%M:%S");
      |                                             ^~~~~~~~~~~~~~~~~~~
slscore/SLSLog.cpp:87:30: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘int64_t’ {aka ‘long int’} [-Wformat=]
   87 |     sprintf(buf_info, "%s:%03d %s %s: %s\n" , cur_time, cur_time_msec, APP_NAME, LOG_LEVEL_NAME[level], buf);
      |                           ~~~^                          ~~~~~~~~~~~~~
      |                              |                          |
      |                              int                        int64_t {aka long int}
      |                           %03ld
slscore/SLSLog.cpp:88:12: warning: format not a string literal and no format arguments [-Wformat-security]
   88 |     printf(buf_info);
      |            ^~~~~~~~
g++ -c -g slscore/common.cpp -o obj/common.o 
In file included from slscore/common.cpp:48:
slscore/common.hpp:120:1: warning: ‘typedef’ was ignored in this declaration
  120 | typedef struct ts_info {
      | ^~~~~~~
slscore/common.cpp: In function ‘void sls_gettime_default_string(char*)’:
slscore/common.cpp:102:45: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  102 |     sls_gettime_fmt(cur_time, cur_time_sec, "%Y-%m-%d %H:%M:%S");
      |                                             ^~~~~~~~~~~~~~~~~~~
g++ -c -g slscore/conf.cpp -o obj/conf.o 
In file included from slscore/conf.cpp:33:
slscore/common.hpp:120:1: warning: ‘typedef’ was ignored in this declaration
  120 | typedef struct ts_info {
      | ^~~~~~~
slscore/conf.cpp:38:36: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
   38 | sls_conf_base_t  sls_first_conf = {"", NULL, NULL} ;
      |                                    ^~
g++ -c -g slscore/SLSThread.cpp -o obj/SLSThread.o -I./ -I../ -I./slscore -I./include
In file included from slscore/SLSLog.hpp:32,
                 from slscore/SLSThread.cpp:31:
slscore/common.hpp:120:1: warning: ‘typedef’ was ignored in this declaration
  120 | typedef struct ts_info {
      | ^~~~~~~
g++ -c -g slscore/SLSEpollThread.cpp -o obj/SLSEpollThread.o -I./ -I../ -I./slscore -I./include
In file included from slscore/SLSLog.hpp:32,
                 from slscore/SLSEpollThread.cpp:31:
slscore/common.hpp:120:1: warning: ‘typedef’ was ignored in this declaration
  120 | typedef struct ts_info {
      | ^~~~~~~
In file included from slscore/HttpClient.hpp:29,
                 from slscore/SLSRole.hpp:38,
                 from slscore/SLSEpollThread.cpp:33:
slscore/TCPRole.hpp:47:1: warning: ‘typedef’ was ignored in this declaration
   47 | typedef struct DATA_PARAM {
      | ^~~~~~~
In file included from slscore/SLSRole.hpp:38,
                 from slscore/SLSEpollThread.cpp:33:
slscore/HttpClient.hpp:45:1: warning: ‘typedef’ was ignored in this declaration
   45 | typedef struct HTTP_RESPONSE_INFO {
      | ^~~~~~~
slscore/SLSEpollThread.cpp: In member function ‘int CSLSEpollThread::init_epoll()’:
slscore/SLSEpollThread.cpp:60:26: error: ‘SRT_EPOLL_ENABLE_EMPTY’ was not declared in this scope
   60 |     srt_epoll_set(m_eid, SRT_EPOLL_ENABLE_EMPTY);
      |                          ^~~~~~~~~~~~~~~~~~~~~~
slscore/SLSEpollThread.cpp:60:5: error: ‘srt_epoll_set’ was not declared in this scope; did you mean ‘srt_epoll_wait’?
   60 |     srt_epoll_set(m_eid, SRT_EPOLL_ENABLE_EMPTY);
      |     ^~~~~~~~~~~~~
      |     srt_epoll_wait
make: *** [Makefile:73: obj/SLSEpollThread.o] Error 1

Running on multi-IP systems uses only primary listening IP

I have a reflector box set up that happens to be multi-homed (two IPs). When I launch SLS, it binds to the primary IP only. I discovered this like so. Assume server_ip = (ip_1, ip_2) if queried via DNS:

  1. Client connects to server via DNS. DNS hands out ip_2.
  2. Server tries to respond to Client, but transmits via ip_1.
  3. Client shuns udp handshake because it wasn't expecting it via ip_1.

Maybe have a --bind or --listen?

Stream on OBS and receive on OBS media source

Hi Edward,
First of all, Thanks for your work on this.

When I streamed with OBS and tried to display it with the OBS media source, an error occurred in SLS.
Nothing is displayed in the media source.
The log when the error occurred is as follows.

2020-04-20 22:48:47:823 SLS INFO: [0x7fffddec5c90]CSLSSrt::libsrt_accept ok, new sock=344160792, 192.168.0.6:55765.
2020-04-20 22:48:47:826 SLS INFO: [0x7f454e7a0010]CSLSListener::handler, new client[192.168.0.6:55765], fd=344160792.
2020-04-20 22:48:47:826 SLS INFO: [0x7f454e7a0010]CSLSListener::handler, [192.168.0.6:55765], sid 'live.sls.com/live/test'
2020-04-20 22:48:47:827 SLS INFO: [0x7f454e7a0010]CSLSListener::handler, new player[0x7f454e650010]=[192.168.0.6:55765], key_stream_name=uplive.sls.com/live/test, publisher=0x7f454e6c0010, m_list_role->size=1.
2020-04-20 22:48:47:827 SLS INFO: [0x7f454e650010]CSLSRole::add_to_epoll, player, sock=344160792, m_is_write=1, ret=0.
2020-04-20 22:48:47:827 SLS INFO: [0x7fffddede480]CSLSGroup::check_new_role, worker_number=0, player=0x7f454e650010, add_to_epoll fd=344160792, role_map.size=3.
2020-04-20 22:48:47:828 SLS INFO: [0x7fffddec58a8]CSLSMapData::get, get sps pps ok, key=uplive.sls.com/live/test, len=1316.
2020-04-20 22:48:47:985 SLS INFO: [0x7f454e650010]CSLSRole::get_state, get_sock_state, ret=6, call invalid_srt.
2020-04-20 22:48:47:986 SLS ERROR: CSLSSrt::libsrt_neterrno, err=6003, Non-blocking call failure: transmission timed out.
2020-04-20 22:48:47:986 SLS INFO: [0x7f454e650010]CSLSRole::invalid_srt, close sock=344160792, m_state=2.
2020-04-20 22:48:47:986 SLS INFO: [0x7f4544002720]CSLSSrt::libsrt_close, fd=344160792.
2020-04-20 22:48:47:987 SLS INFO: [0x7fffddede480]CSLSGroup::check_invalid_sock, worker_number=0, player=0x7f454e650010, invalid sock=0, state=2, role_map.size=3.
2020-04-20 22:48:47:987 SLS INFO: [0x7fffddede480]CSLSGroup::check_invalid_sock, worker_number=0, player=0x7f454e650010, delete.

I have compiled SRT and SLS.
And I'm testing with the default "sls.conf".
The SRT version is v1.4.1.
The SLS version is V1.4.5.

The streaming URL from OBS is
"srt://192.168.0.6:8080?streamid=uplive.sls.com/live/test"
The URL of the OBS media source is
"srt://192.168.0.6:8080?streamid=live.sls.com/live/test"

Can the OBS media source not receive SRT?
Or is the setting wrong?

I'm sorry that I'm not good at English.
Thanks.

segmentation fault

I have installed your server on raspberry pi with debian(raspbian) with full working srt tools
i have compiled your software without any error
but when i execute it show
segmentation fault
then quit
may you help me

error while loading shared libraries: libsrt.so.1

Hi, my problem is similar to #16, but I'm using centos7 and also my LD_LIBRARY_PATH points to :/usr/lib64:/usr/lib64
also I check /usr/lib64/libsrt.so.1 and that's exists!
./sls: error while loading shared libraries: libsrt.so.1: cannot open shared object file: No such file or directory

issue with a stream already used

Hello,
Your server is really great, I use it quite a lot!
I just have one issue: sometimes, I can't read the stream provided by Ateme or other encoders because I am receiving some wrong streams descriptions. I noticed that this occurs when the streamid has already been used in the past.
I'm sending 1 mpegts feed with 1 audio stream and 1 video stream.
With ffprobe, I get this:

Input #0, mpegts, from 'srt://XXXX':
  Duration: N/A, start: 12937.733333, bitrate: N/A
  Program 1
    Stream #0:0[0x101]: Video: - (Main) ([27][0][0][0] / 0x001B), 0x0 [SAR 1:1 DAR 16:9]
    Stream #0:1[0x102]: Audio: aac_latm (LC) ([17][0][0][0] / 0x0011), 0 Hz
    Stream #0:2[0x1]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
    Stream #0:3[0x2]: Audio: aac_latm (LC) ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp

My player doesn't understand the feed correctly because there are some 'fake' and wrongly described streams (one or two) without video size or audio sample rate, in addition of the correct and 'real' streams.
If I stop and resend my feed with the same configuration with another streamid, everything works just find and this is what I get from ffprobe:

Input #0, mpegts, from 'srt://XXXX':
  Duration: N/A, start: 12937.733333, bitrate: N/A
  Program 1
    Stream #0:0[0x101]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
    Stream #0:1[0x102]: Audio: aac_latm (LC) ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp

I've set the idle_streams_timeout property at 10 in my configurations and waited more than 1 hour between the two connections.

thanks for your help !

Server crashes stating: mkdir ~/sls failed

If following the steps in the README and running ./sls -c ../sls.conf the server crashes with:

2020-05-27 14:08:31:520 SLS INFO: sls_conf_open, parsing conf file='../sls.conf'.
mkdir '~/sls' failed.
2020-05-27 14:08:31:521 SLS INFO: sls_write_pid failed, EXIT!
2020-05-27 14:08:31:521 SLS INFO: exit, stop srt live server...
2020-05-27 14:08:31:521 SLS INFO: exit, release reload_manager_list begin,count=0.
2020-05-27 14:08:31:521 SLS INFO: exit, release reload_manager_list ok.
2020-05-27 14:08:31:521 SLS INFO: exit, release http_stat_client.
2020-05-27 14:08:31:521 SLS INFO: exit, uninit srt .
2020-05-27 14:08:31:521 SLS INFO: exit, close conf.
2020-05-27 14:08:31:521 SLS INFO: exit, bye bye!

Confirmed both on the 1.4.5 release and current master branch.

Running the command from the root of the repo like this appears to work better: bin/sls -c sls.conf (tested on the 1.4.5 release)

Latency configuration

Hi Edward,
I don't understand what is the purpose of latency in the configuration file and what is supposed to do even after I read your documentation about it in this link:
Directives
Could you please explain more about it?

macos support (e.g. epoll)

Hi,
On Macos epoll is not supported (but libuv, kqueue, etc).
So this software is said to work on MacOs, but isn't yet, untill we port it? (Preferable make it available on homebrew for example...)

how can I test with OBS

hi, Edward
how can I test with the OBS, but it require not only the server path, but also the stream key.

btw, what's the meaning of "uplive.sls.com" in the string below
'srt://[your.sls.ip]:8080?streamid=uplive.sls.com/live/test'
is it the stream key?

about end-to-end latency

I test latency as your manul.
Got about 1 sec latency.
How can I boost the latency to about 500 msec or little?
Any advice?

Make Error

CleanShot 2020-03-02 at 12 37 47@2x

Hi:
I meet a Make Error When I run "make" on my Mac .
I think the "epoll.h" does not support Mac
How can I run the project on the mac ?
Thanks!

HEVC Stream recognized as H264

I'm trying to use ffmpeg and SLS to restream a H265/MPEG-TS video stream through SLS, but when I try to play the SRT stream that SLS serves, it is recognized as H264, giving me an audio-only stream.

The UDP-to-SRT ffmpeg call is as follows:
ffmpeg -i udp://239.5.5.1:5004 -c copy -f mpegts "srt://localhost:5554?streamid=transmit/preview/23"

And I Try to play the SRT stream with the following command:
ffplay -i srt://localhost:5554?streamid=player/preview/23

My sls.conf is:

srt {
    worker_threads  1;
    worker_connections 300 ;
	
    log_file logs/error.log ; 
    log_level info;
         
    server {
        listen 5554; 
        latency 20;

        domain_player player;
        domain_publisher transmit;
        backlog 100;
        idle_streams_timeout 10

        app {
            app_player preview ;           
            app_publisher preview ; 
        
            record_hls off;
            record_hls_segment_duration 10;
        }
    }
}

ffplay and ffprobe returns the following stream information:

Input #0, mpegts, from 'srt://localhost:5554?streamid=player/preview/23':
  Duration: N/A, start: 0.000000, bitrate: N/A
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 ([27][0][0][0] / 0x001B), none, 24 tbr, 90k tbn, 180k tbc
    Stream #0:1[0x101](por): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 66 kb/s

preceded by a very long repetition of the following error:

[h264 @ 0x7ff92001cb40] no frame!
[h264 @ 0x7ff92001cb40] missing picture in access unit with size 185319
[h264 @ 0x7ff92001cb40] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 0x7ff92001cb40] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. ([email protected])
[h264 @ 0x7ff92001cb40] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 0x7ff92001cb40] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. ([email protected])

The Stream given to SLS is definitly HEVC:

Input #0, mpegts, from 'udp://239.5.5.1:5004':
  Duration: N/A, start: 4.813333, bitrate: N/A
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (HEVC / 0x43564548), yuv420p(tv), 1920x1080, 24 tbr, 90k tbn, 90k tbc
    Stream #0:1[0x101](und): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 65 kb/s
Output #0, mpegts, to 'srt://localhost:5554?streamid=transmit/preview/23':
  Metadata:
    encoder         : Lavf58.39.101
    Stream #0:0: Video: hevc (HEVC / 0x43564548), yuv420p(tv), 1920x1080, q=2-31, 24 tbr, 90k tbn, 90k tbc
    Stream #0:1(und): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 65 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)

Compilation issues

HI, I encountered this problem when I compiled, does anyone know how to solve it? Thank you!!!
Screenshot from 2020-02-18 17-52-37

Config file parameters and explanation?

Hi,

I wanted to try this but I don't get some of the config file parameters.

How the relay works, if there's something more than a relay app, what relay mode is, etc.

Is there any chance to have a config file explanation, please? Thank you!

Operation and use error

[root@server bin]# ./sls -c ../sls.conf
./sls: error while loading shared libraries: libsrt.so.1: cannot open shared object file: No such file or directory
[root@server bin]#

Clarification about the domains in the URL

Hi Edward, congratulations for this awesome piece of software.

I hope you find the time to answer this question. I am a little confused about the domains, the apps, and the SRT url.

So imagine the SLS is in my company domain, a fictional "quahog.tv", for convenience listening on the default port, whichever it is:

So in order to reach the ingestion and the playout URLs, as stated in the docs, I would connect to

srt://quahog.tv?streamid=quahog.tv/live/test
srt://quahog.tv?streamid=quahog.tv/uplive/test

Why is it interesting to define those domains in the config file and pass them as parameters? Wouldn´t it be similar to something like the below URLs where the domain is inferred?

srt://quahog.tv/live/test
srt://quahog.tv/uplive/test

In fact, what confuses me is, in the Directives Wiki, under the "app_player" directive you point that out:

      # player app name, the srt url is like rtmp's, such as :srt://domain/live/stream_name ;
     app_player live;           

Also, the word "domain", does the use case implies that such DNS domain would exist, or I can use a word, like "playout" and "publish"?

I´d appreciate if you could elaborate a little about this. Thanks in advance, and keep up the good work!

srt转推

srt live server支持srt转推吗

Can't play srt stream through media source on OBS 25.0.8 (Ubuntu Server 20.04).

OS: Ubuntu Server 20.04
SLS version: 1.4.6
SRT version: 1.4.1
OBS Linux version: 25.0.8

Not sure what I am doing wrong here! The server is running smoothly. I can even add the server as media source in OBS on Windows, and it plays really nicely with low latency and all.

But the second I add the same information into media source on Linux, it will not run. I have compiled ffmpeg with libsrt and everything needed. I can play the stream through ffplay on the same Linux system I have the server running on. So the server is up and running, and I can play it with ffplay on Linux and it works on Windows OBS - but it just refuses to start the media in OBS on Linux.

Windows OBS (working, using internal IP):

Linux OBS (not working, tried using internal IP and external IP): No need to link image. It's the same settings, but with a black screen. It's not picking up the stream.

Linux FFPLAY (ffplay via terminal):

I have tried changing/forcing input formats like hevc and mpegts in OBS on Linux, but there is no stream coming through. I have tried unchecking and checking all the settings in media source, nothing really changes.

I have tried mode=listener as well, didn't work. srt://127.0.0.1:port?mode=listener

I mean, it's quite clear that libsrt is enabled and working, since I'm using the protocol through ffplay. And the stream is working perfectly in OBS on Windows. I guess one weird thing, is that I cant watch the stream on VLC by adding the srt url, I have to use ffplay to get the srt stream to work through VLC.

Anyway! What am I missing here? I have tried re-installing OBS on Linux, with no luck. I have yet to compile one from source though. I will try that as a next step.

Docker image / file ?

Hey Edward-Wu ,
I love your Project. Is it possible to get the server as a Dockerimage ?

greetings Jonas Dautel

Statistics

Hello Edward,

I would like to be able to see the SRT statistics (Dropped packages, RTT, etc...).
I configured the stat_post_url and my API is called all 5 seconds, however the call is empty. There are no query string nor request body. How can I now access the statistics?

Cheers,
Yannis

SRT ingest and routing

We are seeking to use SLS as a server-side ingest streamer for SRT streams originating from different sites. We intend to take the received streams and perform some video and audio processing before restreaming to the distribution network. Ideally all remote sites would connect to the same server IP:port and differentiate their streams via streamID. Does SLS support routing the received streams based on their streamID to different local destinations, such as UDP://localhost:uniqueport? (Note that the local apps do not support SRT input directly)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.