更新环境
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install tclsh pkg-config cmake libssl-dev build-essential zlib1g-dev git
下载和编译srt
$ sudo git clone https://github.com/Haivision/srt.git
$ cd srt
$ sudo ./configure
$ sudo make
$ sudo make install
$ cd ..
下载和编译srt-live-server
$ sudo git clone https://github.com/Edward-Wu/srt-live-server.git
$ cd srt-live-server
$ sudo make
$ cd bin
$ ./sls –h
到这一步有可能会报错:
./sls: error while loading shared libraries: libsrt.so.1: cannot open shared object file: No such file or directory
这里是需要在 ~/.bashrc
中指定srt安装路径。
首先要查找libsrt.so.1所在的目录,再把这个目录配置给~/.bashrc
$ cd /
$ find –name libsrt.so.1
./srt/libsrt.so.1.4
表示srt安装的目录是/srt
下面就可以配置安装目录
配置环境变量使之生效
$ sudo echo "export LD_LIBRARY_PATH=/srt/" >> ~/.bashrc
$ source ~/.bashrc
重新编译
$ cd /srt-live-server/bin
$ ./sls -h
运行启动服务
./sls -c ../sls.conf
$ cd /
$ cd /