yfm12上
sudo yum install epel-release
sudo rpm -v --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
sudo yum install -y ffmpeg ffmpeg-devel
ffmpeg -version
将flv视频文件转换为mp4视频文件
ffmpeg -i beeen.flv -y -vcodec copy -acodec copy beeen.mp4
将mp4转为完整的ts
ffmpeg -i test.mp4 -c copy -bsf h264_mp4toannexb output.ts
将ts切片,并生成m3u8文件
ffmpeg -i output.ts -c copy -map 0 -f segment -segment_list playlist.m3u8 -segment_time 5 output%03d.ts
[root@yfm12 ffmpeg]# ll
total 11528
-rw-r--r-- 1 root root 1966480 May 19 15:05 output000.ts
-rw-r--r-- 1 root root 2016488 May 19 15:05 output001.ts
-rw-r--r-- 1 root root 3981840 May 19 15:04 output.ts
-rw-r--r-- 1 root root 173 May 19 15:05 playlist.m3u8
-rw-r--r-- 1 root root 3825533 May 19 15:02 test.mp4
red5
https://github.com/Red5/red5-server/releases
避免jdk11,我这里下载red5-server-1.1.1.tar.gz
tar -zxvf red5-server-1.1.1.tar.gz
cd red5-server
vi conf/red5.properties
# HTTP
http.host=192.168.199.112
http.port=5080
# RTMP
rtmp.host=192.168.199.112
rtmp.port=1935
添加red5到系统启动项
vi /etc/init.d/red5
#!/bin/bash
# For RedHat and cousins:
# chkconfig: 2345 85 85
# description: Red5 flash streaming server
# processname: red5
# Created By: BoTao Zhao (botaozhao@foxmail.com)
PROG=red5
RED5_HOME=/data/red5/red5-server
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid
# Source function library
. /etc/rc.d/init.d/functions
[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5
RETVAL=0
case "$1" in
start)
echo -n $"Starting $PROG: "
cd $RED5_HOME
$DAEMON >/dev/null 2>/dev/null &
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo $! > $PIDFILE
touch /var/lock/subsys/$PROG
fi
[ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
echo
;;
stop)
echo -n $"Shutting down $PROG: "
killproc -p $PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
;;
restart)
$0 stop
$0 start
;;
status)
status $PROG -p $PIDFILE
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
esac
exit $RETVAL
chmod +x /etc/rc.d/init.d/red5
service red5 start
obs
下载地址: https://obsproject.com/