Skip to content

Commit

Permalink
Merge pull request #48 from yyjqr/y.j-detect-2023
Browse files Browse the repository at this point in the history
Y.j detect 2023
  • Loading branch information
yyjqr authored Aug 19, 2023
2 parents 919ccdd + 6a45376 commit cda9499
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
12 changes: 6 additions & 6 deletions pySpider/searchOpt/techRank_DB_opt_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def mail():
except Exception as e:
print (str(e))
try:
encrypt_and_verify_url.run_cmd_Popen_fileno("nc -v 34.72.71.171 443")
encrypt_and_verify_url.run_cmd_Popen_fileno("nc -v -w 4 34.72.71.171 443")
except Exception as e:
print (str(e))

Expand All @@ -418,16 +418,16 @@ def mail():
msg.attach(make_img_msg(imgPath))
else:
print("no pic capture!")
msg['From']=formataddr(["Eangel Robot pi4B",my_sender]) #括号里的对应发件人邮箱昵称、发件人邮箱账号
msg['To']=formataddr(["亲爱的用户",receiver]) #括号里的对应收件人邮箱昵称、收件人邮箱账号
msg['Subject']="EXAID 价值Rank %s" %year_month #邮件的主题,也可以说是标题
msg['From']=formataddr(["Eangel Robot pi4B",my_sender]) #括号里的对应发件人邮箱昵称
msg['To']=formataddr(["亲爱的用户",receiver]) #括号里的对应收件人邮箱
msg['Subject']="EXAID 价值Rank PI %s" %year_month #邮件的主题

server=smtplib.SMTP_SSL("smtp.qq.com",465) #发件人邮箱中的SMTP服务器,端口是25 (默认)---------->465
server.login(my_sender,_pwd.decode("utf-8")) #括号中对应的是发件人邮箱账号、邮箱密码
server.sendmail(my_sender,[receiver,],msg.as_string()) #括号中对应的是发件人邮箱账号、收件人邮箱账号、发送邮件
print ('SEND NEWS AND IMG OK')
server.quit() #这句是关闭连接的意思
except Exception as e: #如果try中的语句没有执行,则会执行下面的ret=False
server.quit() #这句是关闭连接
except Exception as e: #
print (str(e))
ret=False
return ret
Expand Down
22 changes: 19 additions & 3 deletions videoRecord/videoRecordH264/video_Record_h264.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ int MSG_LEVEL_OFF = 0;
int MSG_LEVEL_MAX =5;
int trace_level = MSG_LEVEL_OFF;
int b_dump = 0;
const string str_saveDir="/home/pi/Videos/";

const string str_saveDir="/home/ai/Videos/";

// 判断文件是否存在
bool IsPathExist(const std::string &path) {
if (access(path.c_str(), 0) == F_OK) {
return true;
}
return false;
}

int main(int argc, char **argv)
{
Expand Down Expand Up @@ -112,6 +119,15 @@ int main(int argc, char **argv)
return -1;
}

if(IsPathExist(str_saveDir)){
cout << " save path exists\n";
}
else{
char mkdir_cmd[20]="";
sprintf(mkdir_cmd,"mkdir -p %s",str_saveDir.c_str());
system(mkdir_cmd);
}

t = time(&timep); //放在循环里面才行,外面的话,时间是一个固定的,不符合要求!!!0907
local = localtime(&t); //转为本地时间
strftime(buf, 64, "%Y-%m-%d_%H%M%S", local);
Expand All @@ -128,7 +144,7 @@ int main(int argc, char **argv)
// VideoWriter writer(pVideoFileName, VideoWriter::fourcc('M', 'P', '4', '2'), videoCapturer.get(CAP_PROP_FPS),
// Size(videoCapturer.get(CAP_PROP_FRAME_WIDTH), videoCapturer.get(CAP_PROP_FRAME_HEIGHT)));
// X,V,I,D --- H264 DIVX -mp4
VideoWriter writer(pVideoFileName, VideoWriter::fourcc('H', '2', '6', '4'), videoCapturer.get(CAP_PROP_FPS),
VideoWriter writer(pVideoFileName, VideoWriter::fourcc('H', '2', '6', '4'), videoCapturer.get(CAP_PROP_FPS),
Size(videoCapturer.get(CAP_PROP_FRAME_WIDTH), videoCapturer.get(CAP_PROP_FRAME_HEIGHT)));
recordFlag = 1;
pthread_create(&record_thread_t, NULL, record_thread, NULL);
Expand Down

0 comments on commit cda9499

Please sign in to comment.