centos使用ffmpeg将rtsp转rtmp 视频转码
目前web端对rtsp的播放甚是不便,所以考虑将rtsp流转码成rtmp给web端播放。
一、安装ffmpeg
安装依赖:
yum install -y epel-release rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
yum repolist
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-1.el7.nux.noarch.rpm
yum repolist
安装ffmpeg:
yum install -y ffmpeg
ffmpeg -version
二、运行与测试
ffmpeg命令参数如下:
转码指令(这里使用守护进程):
sudo nohup ffmpeg -f rtsp -rtsp_transport tcp -i 'rtsp://****你的rtsp地址****' -codec copy -f flv -an 'rtmp://localhost:1935/test/321'
这里最好是用sudo。
还没有评论,来说两句吧...