1. 安装ffmpeg

$ git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
$ sudo apt-get install yasm
$ sudo ./configure --enable-shared --prefix=/usr/local/ffmpeg
$ make
$ sudo make install

$ ffmpeg -version

$ sudo vi /etc/ld.so.conf
# 追加lib位置
# /usr/local/ffmpeg/lib
$ ldconfig

2. 安装nginx

$ sudo git clone https://github.com/arut/nginx-rtmp-module.git
$ sudo wget http://nginx.org/download/nginx-1.16.0.tar.gz
$ sudo tar -xvf nginx-1.16.0.tar.gz
$ sudo apt-get install openssl-devel
$ sudo apt-get install libssl-dev
$ sudo  ./configure --prefix=/usr/local/src/nginx  --add-module=../nginx-rtmp-module  --with-http_ssl_module
# 启动
$ sudo ./sbin/nginx -c ./conf/nginx.conf

3. 推送

推送:
ffmpeg -rtsp_transport tcp -i "rtsp://admin:abcd1234@3s.net579.com:28144/cam/realmonitor?channel=16&subtype=0" -f flv -r 25 -s 640x360 -an rtmp://152.136.136.220:1935/live/room

ffmpeg -rtsp_transport tcp -i "rtsp://admin:abcd1234@3s.net579.com:28144/cam/realmonitor?channel=16&subtype=0" -f flv -r 25 -s 640x360 -an rtmp://localhost:1935/live/room


李春雨
325 声望188 粉丝