提交 14d06254 authored 作者: blu's avatar blu

init

上级 0afd21e5
...@@ -253,9 +253,9 @@ protected: ...@@ -253,9 +253,9 @@ protected:
AVPacket packet, keyPacket; AVPacket packet, keyPacket;
av_init_packet(&keyPacket); av_init_packet(&keyPacket);
while (true) { while (true) {
auto start = chrono::steady_clock::now(); auto start = chrono::system_clock::now();
auto end = start; auto end = start;
string name = to_string(start.time_since_epoch().count()) + ".mp4"; string name = to_string(chrono::duration_cast<chrono::seconds>(start.time_since_epoch()).count()) + ".mp4";
name = urlOut + "/" + name; name = urlOut + "/" + name;
ret = avformat_alloc_output_context2(&pAVFormatRemux, NULL, "mp4", name.c_str()); ret = avformat_alloc_output_context2(&pAVFormatRemux, NULL, "mp4", name.c_str());
if (ret < 0) { if (ret < 0) {
...@@ -351,7 +351,7 @@ protected: ...@@ -351,7 +351,7 @@ protected:
spdlog::error("error muxing packet"); spdlog::error("error muxing packet");
} }
end = chrono::steady_clock::now(); end = chrono::system_clock::now();
}// while in slice }// while in slice
// write tail // write tail
av_write_trailer(pAVFormatRemux); av_write_trailer(pAVFormatRemux);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论