提交 cef62cf0 authored 作者: blu's avatar blu

upload video files

上级 66808f5d
...@@ -122,8 +122,23 @@ private: ...@@ -122,8 +122,23 @@ private:
int *streamList = nullptr, numStreams = 0, iid; int *streamList = nullptr, numStreams = 0, iid;
time_t tsLastBoot, tsUpdateTime; time_t tsLastBoot, tsUpdateTime;
json config; json config;
string proto = "rtsp";
string drport = "5549"; string drport = "5549";
bool isIpStr(string ip) {
int cnt = 3*4 + 3;
if(ip.size() == 0 || ip.size() > cnt) {
return false;
}
auto v = strutils::split(ip, '.');
if(v.size() == 0 || v.size () != 4){
return false;
}
return true;
}
int ping() int ping()
{ {
int ret = 0; int ret = 0;
...@@ -183,19 +198,24 @@ private: ...@@ -183,19 +198,24 @@ private:
ipcPort = to_string(ipc["port"]); ipcPort = to_string(ipc["port"]);
} }
// string ipcAddr = ipc["addr"].get<string>();
if(1){ if(isIpStr(ipcAddr)){
string chan = "ch1"; string chan = "ch1";
string streamName = "main"; string streamName = "main";
if(evslicer.count("channel") != 0 && !evslicer["channel"].get<string>().empty()){ if(ipc.count("channel") != 0 && !ipc["channel"].get<string>().empty()){
chan = evslicer["channel"].get<string>(); chan = ipc["channel"].get<string>();
} }
if(evslicer.count("streamName") != 0 && !evslicer["streamName"].get<string>().empty()){ if(ipc.count("streamName") != 0 && !ipc["streamName"].get<string>().empty()){
streamName = evslicer["streamName"].get<string>(); streamName = ipc["streamName"].get<string>();
}
if(ipc.count("proto") != 0 && !ipc["proto"].get<string>().empty()){
proto = ipc["proto"];
} }
urlIn = "rtsp://" + user + ":" + passwd + "@" + ipc["addr"].get<string>() + ":" + ipcPort + "/h264/" + chan + "/" + streamName + "/av_stream";
urlIn = proto + "://" + user + ":" + passwd + "@" + ipc["addr"].get<string>() + ":" + ipcPort + "/h264/" + chan + "/" + streamName + "/av_stream";
}else{ }else{
urlIn = ipc["addr"].get<string>(); urlIn = ipcAddr;
} }
addr = evpuller["addr"].get<string>(); addr = evpuller["addr"].get<string>();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论