check_ffmpeg_status
function check_ffmpeg_status() { video_index=$1 status=`ps aux |grep '/usr/local/ffmpeg/bin/ffmpeg' |grep $video_index |grep -v grep |wc -l` if [ $status -lt 1] then echo $video_index status error return 0 fi echo $video_index status normal return 1 } time=`date` echo $time check video status check_ffmpeg_status 131 if [ $? -eq 0 ] then nohup /usr/local/ffmpeg/bin/ffmpeg -buffer_size 4096000 -stimeout 5000 -rtsp_transport tcp -i rtsp://user:u12345678@192.168.1.131:554/Streaming/Channels/101?transportmode=multicast -g 5 -b 700000 -max_delay 100 -vcodec copy -acodec copy -f flv -r 30 -s 1920x1080 -y rtmp://192.168.1.230:18081/mylive/101 >> /tmp/ffmpeg_logs/101.log 2>& 1 & fi
#!/bin/sh pkill ffmpeg ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin12345@10.131.240.180:18092/Streaming/Channels/102?transportmode=unicast" -vcodec libx264 -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/robit" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.178:1555/h264/ch1/sub/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/light1" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.178:1557/h264/ch1/sub/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/light2" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.178:1559/h264/ch1/sub/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/light3" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.178:1561/h264/ch1/sub/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/light4" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.178:1556/h264/ch1/sub/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/red1" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.178:1558/h264/ch1/sub/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/red2" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.178:1560/h264/ch1/sub/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/red3" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.178:1562/h264/ch1/sub/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/red4" & #三灶站 #1-2 可见光 3-4 红外测温 按照1号主变 2号主变 顺序 ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.224:1558/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/sanzao1" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.224:1556/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/sanzao2" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.224:1557/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/sanzao3" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.224:1555/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/sanzao4" & #祖冲站 #1号主变红外 ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.226:1555/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/zuchong1" & #1号主变可见光 ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.226:1556/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/zuchong2" & #2号主变红外 ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.226:1557/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/zuchong3" & #2号主变可见光 ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.226:1558/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/zuchong4" & #时珍站 #1号主变红外 ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.227:1555/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/shizhen1" & #1号主变可见光 ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.227:1556/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/shizhen2" & #2号主变红外 ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.227:1557/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/shizhen3" & #2号主变可见光 ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin123@10.131.240.227:1558/h264/ch1/main/av_stream" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/shizhen4" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:zpdl2018#@10.131.240.178:1563/Streaming/Channels/102?transportmode=unicast&profile=Profile_2" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/kaiguan1" & ffmpeg -rtsp_transport tcp -i "rtsp://admin:yjh12345@10.131.240.180:18095/Streaming/Channels/101?transportmode=unicast" -b 4096k -f flv -r 25 -s 640x320 -an "rtmp://10.131.250.253:1935/mylive/kaiguan2" & ffmpeg -re -stream_loop -1 -i /opt/mylive5-server/webapps/oflaDemo/streams/Avengers2.mp4 -vcodec libx264 -acodec aac -f flv "rtmp://localhost/oflaDemo/hello7" & ffmpeg -re -stream_loop -1 -i /opt/mylive5-server/webapps/oflaDemo/streams/Avengers2.mp4 -vcodec libx264 -acodec aac -f flv "rtmp://localhost/oflaDemo/hello8" & #ffmpeg -re -i http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8 -vcodec libx264 -acodec aac -f flv "rtmp://localhost/oflaDemo/hello9" #/data/server/glb-prps/prps/GLB.Prps.Web --urls=http://10.131.250.253:5000/ &