Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
e631e90c
提交
e631e90c
authored
9月 17, 2019
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
big refacting of communitation architect
上级
576d5a09
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
12 行增加
和
11 行删除
+12
-11
evmlmotion.cpp
opencv-motion-detect/evmlmotion.cpp
+1
-1
evpuller.cpp
opencv-motion-detect/evpuller.cpp
+2
-2
evpusher.cpp
opencv-motion-detect/evpusher.cpp
+9
-8
evslicer.cpp
opencv-motion-detect/evslicer.cpp
+0
-0
没有找到文件。
opencv-motion-detect/evmlmotion.cpp
浏览文件 @
e631e90c
...
@@ -639,7 +639,7 @@ protected:
...
@@ -639,7 +639,7 @@ protected:
av_packet_unref
(
&
packet
);
av_packet_unref
(
&
packet
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
spdlog
::
error
(
"error muxing packet"
);
spdlog
::
error
(
"e
vmlmotion e
rror muxing packet"
);
}
}
}
}
...
...
opencv-motion-detect/evpuller.cpp
浏览文件 @
e631e90c
...
@@ -188,7 +188,7 @@ private:
...
@@ -188,7 +188,7 @@ private:
ipcPort
=
to_string
(
ipc
[
"port"
]);
ipcPort
=
to_string
(
ipc
[
"port"
]);
}
}
urlIn
=
"rtsp://"
+
user
+
":"
+
passwd
+
"@"
+
ipc
[
"addr"
].
get
<
string
>
()
+
":"
+
ipcPort
+
"/h264/ch1/
sub
/av_stream"
;
urlIn
=
"rtsp://"
+
user
+
":"
+
passwd
+
"@"
+
ipc
[
"addr"
].
get
<
string
>
()
+
":"
+
ipcPort
+
"/h264/ch1/
main
/av_stream"
;
addr
=
evpuller
[
"addr"
].
get
<
string
>
();
addr
=
evpuller
[
"addr"
].
get
<
string
>
();
spdlog
::
info
(
"evpuller {} connecting to IPC {}"
,
selfId
,
urlIn
);
spdlog
::
info
(
"evpuller {} connecting to IPC {}"
,
selfId
,
urlIn
);
if
(
addr
==
"*"
||
addr
==
"0.0.0.0"
)
{
if
(
addr
==
"*"
||
addr
==
"0.0.0.0"
)
{
...
@@ -401,7 +401,7 @@ public:
...
@@ -401,7 +401,7 @@ public:
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
av_log_set_level
(
AV_LOG_
ERROR
);
av_log_set_level
(
AV_LOG_
INFO
);
spdlog
::
set_level
(
spdlog
::
level
::
info
);
spdlog
::
set_level
(
spdlog
::
level
::
info
);
//DB::exec(NULL, NULL, NULL,NULL);
//DB::exec(NULL, NULL, NULL,NULL);
auto
evp
=
EvPuller
();
auto
evp
=
EvPuller
();
...
...
opencv-motion-detect/evpusher.cpp
浏览文件 @
e631e90c
...
@@ -316,12 +316,8 @@ protected:
...
@@ -316,12 +316,8 @@ protected:
zmq_msg_t
msg
;
zmq_msg_t
msg
;
AVPacket
packet
;
AVPacket
packet
;
uint64_t
pktCnt
=
0
;
uint64_t
pktCnt
=
0
;
int
pktIgnore
=
0
;
while
(
true
)
{
while
(
true
)
{
if
(
checkStop
()
==
true
)
{
bStopSig
=
true
;
break
;
}
// if(1 == getppid()) {
// if(1 == getppid()) {
// spdlog::error("evpusher {} exit since evdaemon is dead", selfId);
// spdlog::error("evpusher {} exit since evdaemon is dead", selfId);
// exit(1);
// exit(1);
...
@@ -354,6 +350,12 @@ protected:
...
@@ -354,6 +350,12 @@ protected:
}
}
zmq_msg_close
(
&
msg
);
zmq_msg_close
(
&
msg
);
if
(
pktCnt
==
0
&&
pktIgnore
<
18
*
7
)
{
pktIgnore
++
;
av_packet_unref
(
&
packet
);
continue
;
}
spdlog
::
debug
(
"packet stream indx: {:d}"
,
packet
.
stream_index
);
spdlog
::
debug
(
"packet stream indx: {:d}"
,
packet
.
stream_index
);
// relay
// relay
AVStream
*
in_stream
=
NULL
,
*
out_stream
=
nullptr
;
AVStream
*
in_stream
=
NULL
,
*
out_stream
=
nullptr
;
...
@@ -378,11 +380,10 @@ protected:
...
@@ -378,11 +380,10 @@ protected:
ret
=
av_interleaved_write_frame
(
pAVFormatRemux
,
&
packet
);
ret
=
av_interleaved_write_frame
(
pAVFormatRemux
,
&
packet
);
av_packet_unref
(
&
packet
);
av_packet_unref
(
&
packet
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
spdlog
::
error
(
"e
rror muxing packet: {}, {}, {}, {}, restreaming..."
,
av_err2str
(
ret
),
packet
.
dts
,
packet
.
pts
,
packet
.
dts
==
AV_NOPTS_VALUE
);
spdlog
::
error
(
"e
vpusher {} error muxing packet: {}, {}, {}, {}, restreaming..."
,
selfId
,
av_err2str
(
ret
),
packet
.
dts
,
packet
.
pts
,
packet
.
dts
==
AV_NOPTS_VALUE
);
if
(
pktCnt
!=
0
&&
packet
.
pts
==
AV_NOPTS_VALUE
)
{
if
(
pktCnt
!=
0
&&
packet
.
pts
==
AV_NOPTS_VALUE
)
{
// reset
// reset
av_write_trailer
(
pAVFormatRemux
);
av_write_trailer
(
pAVFormatRemux
);
this_thread
::
sleep_for
(
chrono
::
seconds
(
5
));
freeStream
();
freeStream
();
getInputFormat
();
getInputFormat
();
setupStream
();
setupStream
();
...
@@ -467,7 +468,7 @@ public:
...
@@ -467,7 +468,7 @@ public:
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
av_log_set_level
(
AV_LOG_
ERROR
);
av_log_set_level
(
AV_LOG_
INFO
);
spdlog
::
set_level
(
spdlog
::
level
::
info
);
spdlog
::
set_level
(
spdlog
::
level
::
info
);
EvPusher
pusher
;
EvPusher
pusher
;
pusher
.
join
();
pusher
.
join
();
...
...
opencv-motion-detect/evslicer.cpp
浏览文件 @
e631e90c
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论