[root@centos ~]# vi /usr/local/bin/record_done.shソス@ソスソスソス@ソスソスソスCソスuソスzソスMソス^ソスソスtソス@ソスCソスソスソスソスソスソスソスyソス[ソスWソスソスソスソスソスXソスNソスソスソスvソスgソス成
#!/bin/bash
# ${1} path - recorded file path (/tmp/rec/mystream-1389499351.flv)
# ${2} filename - path with directory omitted (mystream-1389499351.flv)
# ${3} basename - file name with extension omitted (mystream-1389499351)
# ${4} dirname - directory path (/tmp/rec)
# ソス^ソスソスtソス@ソスCソスソスソスフサソスソスソスlソスCソスソスソス鞫懶ソス成
JPG_NAME=${4}/${3}.jpg
ffmpeg -y -i ${1} -ss 1 -vframes 1 -f image2 ${JPG_NAME} > /dev/null 2>&1
# MP4ソス`ソスソスソスヨ変奇ソス
ffmpeg -y -i ${1} -vcodec copy -acodec copy ${4}/${3}.mp4
[ $? -eq 0 ] && rm -f ${1}
# ソス^ソスソスtソス@ソスCソスソスソスソスソスソスソスyソス[ソスWソス成
HTML_PATH=`echo ${4} | sed -e 's/\/usr\/local\/nginx\/html\([^ ]*\)/\1/p' -e d`
HTML_NAME=${4}/${3}.html
FLV_NAME=${3}
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' > ${HTML_NAME}
echo ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' >> ${HTML_NAME}
echo '<html xmlns="http://www.w3.org/1999/xhtml">' >> ${HTML_NAME}
echo '<head>' >> ${HTML_NAME}
echo ' <title>'${FLV_NAME}'</title>' >> ${HTML_NAME}
echo ' <link href="//vjs.zencdn.net/5.11.6/video-js.css" rel="stylesheet">' >> ${HTML_NAME}
echo '</head>' >> ${HTML_NAME}
echo '<body>' >> ${HTML_NAME}
echo ' <video id="'${FLV_NAME}'" class="video-js vjs-default-skin" autoplay="autoplay" controls="controls" width="320" height="240" data-setup="{}">' >> ${HTML_NAME}
echo ' <source src="'${HTML_PATH}/${FLV_NAME}.mp4'">' >> ${HTML_NAME}
echo ' <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-sup
port/" target="_blank">supports HTML5 video</a></p>' >> ${HTML_NAME}
echo ' </video>' >> ${HTML_NAME}
echo '</body>' >> ${HTML_NAME}
echo '</html>' >> ${HTML_NAME}
# ソス^ソスソスtソス@ソスCソスソスソスフ更ソスVソスソスソスソスソスソスソスtソス@ソスCソスソスソス成ソスソスソスソスソスノ変更
tmp=`echo ${3} | sed -e 's/live-\([^ ]*\)/\1/p' -e d`
datetime=`echo ${tmp:0:4}`/`echo ${tmp:4:2}`/`echo ${tmp:6:2}`' '`echo ${tmp:8:2}`:`echo ${tmp:10:2}`:`echo ${tmp:12:2}`
touch -d "${datetime}" ${4}/${3}.*
[root@centos ~]# chmod +x /usr/local/bin/record_done.shソス@ソスソスソス@ソスソスソスCソスuソスzソスMソス^ソスソスtソス@ソスCソスソスソスソスソスソスソスyソス[ソスWソスソスソスソスソスXソスNソスソスソスvソスgソスヨ趣ソスソスsソスソスソスソスソスtソスソス
[root@centos ~]# systemctl restart nginxソス@ソスソスソス@nginxソスト起ソスソス
|
|