Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
59d3eb08
提交
59d3eb08
authored
8月 19, 2019
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init
上级
c8fda97d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
4 行增加
和
10 行删除
+4
-10
evslicer.cpp
opencv-motion-detect/evslicer.cpp
+4
-10
没有找到文件。
opencv-motion-detect/evslicer.cpp
浏览文件 @
59d3eb08
...
@@ -24,8 +24,8 @@ using namespace std;
...
@@ -24,8 +24,8 @@ using namespace std;
class
EvSlicer
:
public
TinyThread
{
class
EvSlicer
:
public
TinyThread
{
private
:
private
:
#define URLOUT_DEFAULT "slices"
#define URLOUT_DEFAULT "slices"
#define NUM_DAYS_DEFAULT
2
#define NUM_DAYS_DEFAULT
5
#define MINUTES_PER_SLICE_DEFAULT
1
#define MINUTES_PER_SLICE_DEFAULT
2
// 2 days, 10 minutes per record
// 2 days, 10 minutes per record
#define NUM_SLICES_DEFAULT (24 * NUM_DAYS_DEFAULT * 60 / MINUTES_PER_SLICE_DEFAULT)
#define NUM_SLICES_DEFAULT (24 * NUM_DAYS_DEFAULT * 60 / MINUTES_PER_SLICE_DEFAULT)
void
*
pSubCtx
=
NULL
,
*
pReqCtx
=
NULL
;
// for packets relay
void
*
pSubCtx
=
NULL
,
*
pReqCtx
=
NULL
;
// for packets relay
...
@@ -211,14 +211,6 @@ private:
...
@@ -211,14 +211,6 @@ private:
}
}
}
}
// ret = avformat_alloc_output_context2(&pAVFormatRemux, NULL, "mpg", urlOut.c_str());
// if (ret < 0) {
// spdlog::error("evslicer {} {} failed create avformatcontext for output: %s", sn, iid, av_err2str(ret));
// exit(1);
// }
//spdlog::info("evslicer {} {} numStreams: {:d}", sn, iid, pAVFormatInput->nb_streams);
int
streamIdx
=
0
;
int
streamIdx
=
0
;
// find all video & audio streams for remuxing
// find all video & audio streams for remuxing
streamList
=
(
int
*
)
av_mallocz_array
(
pAVFormatInput
->
nb_streams
,
sizeof
(
*
streamList
));
streamList
=
(
int
*
)
av_mallocz_array
(
pAVFormatInput
->
nb_streams
,
sizeof
(
*
streamList
));
...
@@ -263,6 +255,7 @@ protected:
...
@@ -263,6 +255,7 @@ protected:
exit
(
1
);
exit
(
1
);
}
}
// build output avformatctx
for
(
int
i
=
0
;
i
<
pAVFormatInput
->
nb_streams
;
i
++
)
{
for
(
int
i
=
0
;
i
<
pAVFormatInput
->
nb_streams
;
i
++
)
{
if
(
streamList
[
i
]
!=
-
1
)
{
if
(
streamList
[
i
]
!=
-
1
)
{
out_stream
=
avformat_new_stream
(
pAVFormatRemux
,
NULL
);
out_stream
=
avformat_new_stream
(
pAVFormatRemux
,
NULL
);
...
@@ -290,6 +283,7 @@ protected:
...
@@ -290,6 +283,7 @@ protected:
spdlog
::
error
(
"evslicer {} {} error occurred when opening output file"
,
sn
,
iid
);
spdlog
::
error
(
"evslicer {} {} error occurred when opening output file"
,
sn
,
iid
);
}
}
// TODO:
if
(
keyPacket
.
buf
!=
NULL
)
{
if
(
keyPacket
.
buf
!=
NULL
)
{
ret
=
av_interleaved_write_frame
(
pAVFormatRemux
,
&
packet
);
ret
=
av_interleaved_write_frame
(
pAVFormatRemux
,
&
packet
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论