RTSP转rtmp

1.安装ffmpeg

yum install epel-release -y
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
yum install ffmpeg ffmpeg-devel -y

2.docker安装alfg/nginx-rtmp

docker run -itd -p 1935:1935 -p 8085:80 --name nginx_ffmpeg alfg/nginx-rtmp

3.开启rtsp转rtmp

nohup ffmpeg -f rtsp -rtsp_transport tcp -i 'rtsp://192.168.1.212:8557/sub_stream_1' -codec copy -f flv -an 'rtmp://192.168.1.122:1935/stream/test' > /data/ffmpeg/logs/ffmpeg.log 2>&1 &  

4.通过vlc等播放器通过rtmp地址访问

打开vlc播放器,点击媒体-网路串流

输入rtmp://192.168.1.122:1935/stream/test

等待8s左右即可出现视频画面,但是会有8s左右延迟