提交 130d077b authored 作者: blu's avatar blu

init

上级 4a60847c
...@@ -315,7 +315,7 @@ public: ...@@ -315,7 +315,7 @@ public:
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
av_log_set_level(AV_LOG_ERROR); av_log_set_level(AV_LOG_ERROR);
spdlog::set_level(spdlog::level::debug); spdlog::set_level(spdlog::level::info);
EvMgr mgr; EvMgr mgr;
mgr.join(); mgr.join();
return 0; return 0;
......
...@@ -569,8 +569,8 @@ protected: ...@@ -569,8 +569,8 @@ protected:
} }
} }
zmq_msg_close(&msg); zmq_msg_close(&msg);
if(pktCnt % 1024 == 0) { if(pktCnt % EV_LOG_PACKET_CNT == 0) {
spdlog::info("seq: {}, pts: {}, dts: {}, dur: {}, idx: {}", pktCnt, packet.pts, packet.dts, packet.duration, packet.stream_index); spdlog::info("seq: {}, pts: {}, dts: {}, idx: {}", pktCnt, packet.pts, packet.dts, packet.stream_index);
} }
pktCnt++; pktCnt++;
......
...@@ -296,7 +296,7 @@ protected: ...@@ -296,7 +296,7 @@ protected:
av_packet_unref(&packet); av_packet_unref(&packet);
continue; continue;
} }
if(pktCnt % 1024 == 0) { if(pktCnt % EV_LOG_PACKET_CNT == 0) {
spdlog::info("pktCnt: {:d}", pktCnt); spdlog::info("pktCnt: {:d}", pktCnt);
} }
......
...@@ -351,8 +351,12 @@ protected: ...@@ -351,8 +351,12 @@ protected:
continue; continue;
} }
// decode if(pktCnt % EV_LOG_PACKET_CNT == 0) {
spdlog::info("seq: {}, pts: {}, dts: {}, idx: {}", pktCnt, packet.pts, packet.dts, packet.stream_index);
}
pktCnt++; pktCnt++;
// decode
ret = AVPacketSerializer::decode((char*)zmq_msg_data(&msg), ret, &packet); ret = AVPacketSerializer::decode((char*)zmq_msg_data(&msg), ret, &packet);
{ {
if (ret < 0) { if (ret < 0) {
...@@ -369,10 +373,6 @@ protected: ...@@ -369,10 +373,6 @@ protected:
packet.stream_index = streamList[packet.stream_index]; packet.stream_index = streamList[packet.stream_index];
out_stream = pAVFormatRemux->streams[packet.stream_index]; out_stream = pAVFormatRemux->streams[packet.stream_index];
//calc pts
if(pktCnt % (18*60*5) == 0) {
spdlog::info("seq: {:lld}, pts: {:lld}, dts: {:lld}, dur: {:lld}, idx: {:d}", pktCnt, packet.pts, packet.dts, packet.duration, packet.stream_index);
}
/* copy packet */ /* copy packet */
if(pktCnt == 0) { if(pktCnt == 0) {
packet.pts = 0; packet.pts = 0;
......
...@@ -402,8 +402,8 @@ protected: ...@@ -402,8 +402,8 @@ protected:
out_stream = pAVFormatRemux->streams[packet.stream_index]; out_stream = pAVFormatRemux->streams[packet.stream_index];
//calc pts //calc pts
if(pktCnt % 1024 == 0) { if(pktCnt % EV_LOG_PACKET_CNT == 0) {
spdlog::info("seq: {}, pts: {}, dts: {}, dur: {}, idx: {}", pktCnt, packet.pts, packet.dts, packet.duration, packet.stream_index); spdlog::info("seq: {}, pts: {}, dts: {}, idx: {}", pktCnt, packet.pts, packet.dts, packet.stream_index);
} }
/* copy packet */ /* copy packet */
if(pktCnt == 0) { if(pktCnt == 0) {
...@@ -481,6 +481,7 @@ public: ...@@ -481,6 +481,7 @@ public:
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
av_log_set_level(AV_LOG_ERROR);
spdlog::set_level(spdlog::level::info); spdlog::set_level(spdlog::level::info);
EvSlicer es; EvSlicer es;
es.join(); es.join();
......
...@@ -17,6 +17,8 @@ using json = nlohmann::json; ...@@ -17,6 +17,8 @@ using json = nlohmann::json;
#define PS_MARK_E "DEADBEEF" #define PS_MARK_E "DEADBEEF"
#define PS_MARK_S "BEEFDEAD" #define PS_MARK_S "BEEFDEAD"
#define EV_LOG_PACKET_CNT (18*60*5)
void avlogThrow(void *avcl, int lvl, const char *fmt, ...) void avlogThrow(void *avcl, int lvl, const char *fmt, ...)
{ {
(void)avcl; (void)avcl;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论