Merge pull request #13 from W0n9/shell

改进了shell文件的结构
This commit is contained in:
Xu-jianwen 2021-08-14 23:22:27 +08:00 committed by GitHub
commit 7775461233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 20 deletions

4
ip_list.config Normal file
View File

@ -0,0 +1,4 @@
rtsp://admin:123456@192.168.123.235:554/stream1
rtsp://admin:123456@192.168.123.235:554/stream1
rtsp://admin:123456@192.168.123.235:554/stream2
rtsp://admin:123456@192.168.123.235:554/stream2

View File

@ -1,23 +1,41 @@
#!/bin/bash
while true
# while :
# do
# IP=(rtsp://admin:123456@192.168.123.235:554/stream1 \
# rtsp://admin:123456@192.168.123.235:554/stream1 \
# rtsp://admin:123456@192.168.123.235:554/stream2 \
# rtsp://admin:123456@192.168.123.235:554/stream2 \
# )
# a=0
# splite="_"
# for ip in ${IP[*]}
# do
# a=$(($a+1))
# date_time=`date "+%Y_%m_%d"`
# SAVE_PATH="/home/pc001/e/lcn/stream/$a/${date_time}"
# if [ ! -d ${SAVE_PATH} ];then mkdir -p ${SAVE_PATH}; fi
# (ffmpeg -i $ip -codec:a aac -b:a 64k -codec:v libx264 -b:v 768k -r 15 -t 60 -s 1280x720 ${SAVE_PATH}/$a${splite}`date +%Y%m%d-%H%M`.mkv
# )&
# done
# done
# exit 0
splite="_"
basePath="/home/pc001/e/lcn/stream"
cat ip_list.config |
while read line
do
IP=(rtsp://admin:123456@192.168.123.235:554/stream1 \
rtsp://admin:123456@192.168.123.235:554/stream1 \
rtsp://admin:123456@192.168.123.235:554/stream2 \
rtsp://admin:123456@192.168.123.235:554/stream2 \
)
a=0
splite="_"
for ip in ${IP[*]}
do
a=$(($a+1))
date_time=$(date "+%Y_%m_%d")
SAVE_PATH="/home/pc001/e/lcn/stream/$a/${date_time}"
if [ ! -d ${SAVE_PATH} ];then mkdir -p ${SAVE_PATH}; fi
(ffmpeg -i $ip -codec:a aac -b:a 64k -codec:v libx264 -b:v 768k -r 15 -t 60 -s 1280x720 ${SAVE_PATH}/$a${splite}`date +%Y%m%d-%H%M`.mkv
)&
done
ip=$line
a=$(($a+1))
date_time=`date "+%Y_%m_%d"`
SAVE_PATH="$basePath/$a/${date_time}"
if [ ! -d ${SAVE_PATH} ];then mkdir -p ${SAVE_PATH}; fi
ffmpeg -i $ip -rtsp_transport http -codec:a aac -b:a 64k -codec:v libx264 -b:v 768k -r 15 -t 60 -s 1280x720 ${SAVE_PATH}/$a${splite}`date +%Y%m%d-%H%M`.mkv >/dev/null 2>&1 &
done
exit 0
exit

View File

@ -2,7 +2,7 @@ from deepface import DeepFace
# DeepFace.stream("dataset") #opencv
#DeepFace.stream("dataset", detector_backend = 'opencv')
DeepFace.stream("D:/face/320_database/", detector_backend = 'ssd', enable_face_analysis=False)
DeepFace.stream("D:/face/320_database/", detector_backend = 'ssd', enable_face_analysis=True)
# DeepFace.stream("D:/face/320_database/", detector_backend = 'mtcnn')
#DeepFace.stream("dataset", detector_backend = 'dlib')
# DeepFace.stream("D:/face/320_database/", detector_backend = 'retinaface')