-
ubuntu14.04安装ffmpeg软件
apt-add-repository ppa:mc3man/trusty-media apt-get update apt-get install ffmpeg gstreamer0.10-ffmpeg
-
部署开始和停止录制的脚本文件
#!/bin/bash start(){ if [ ! -d "/usr/local/.video/${HOSTNAME}" ]; then mkdir /usr/local/.video/${HOSTNAME} fi nohup ffmpeg -f x11grab -s 1024x768 -r 1 -i :3.0 -qscale 25 /usr/local/.video/${HOSTNAME}/`date "+%H%M%S"`.avi -c:v mpeg4 -r 1 -f hls -hls_list_size 0 -hls_time 10 -qscale 25 /usr/local/.video/${HOSTNAME}/`date "+%H%M%S"`.m3u8 >/dev/null 2>&1 & } stop(){ for i in `ls /usr/local/.video/${HOSTNAME}/*.m3u8` do echo "#EXT-X-ENDLIST" >> $i done kill -9 `pgrep ffmpeg` } case $1 in start) start;; stop) stop;; *) echo "Usage:$0 {start|stop}" esac