自用的,录制m3u8直播地址,到本地mp4的脚本
#!/bin/bash
url=http://1.m3u8
size="30M"
while :
do
dirname=`date "+%Y%m%d"`
filename=`date "+%H%M%S.mp4"`
echo 'write in to $dirname'
if [ ! -d $dirname ]; then
mkdir $dirname
fi
ffmpeg -i $url -fs ${size} -vcodec copy -an ${dirname}/${filename}
echo 'write end'
if [[ $filename > "1730" ]]; then
break
fi
done