diff --git a/src/Record/MP4Recorder.cpp b/src/Record/MP4Recorder.cpp index 35dbeaa0..d3ad5a69 100644 --- a/src/Record/MP4Recorder.cpp +++ b/src/Record/MP4Recorder.cpp @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved. * * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit). @@ -70,7 +70,7 @@ void MP4Recorder::asyncClose() { auto info = _info; WorkThreadPool::Instance().getExecutor()->async([muxer, full_path_tmp, full_path, info]() mutable { //获取文件录制时间,放在关闭mp4之前是为了忽略关闭mp4执行时间 - info.time_len = (float) (::time(NULL) - info.start_time); + //info.time_len = (float) (::time(NULL) - info.start_time); //关闭mp4非常耗时,所以要放在后台线程执行 muxer->closeMP4(); @@ -118,6 +118,7 @@ bool MP4Recorder::inputFrame(const Frame::Ptr &frame) { } if (_muxer) { + _info.time_len = (float) (::time(NULL) - info.start_time); //生成mp4文件 return _muxer->inputFrame(frame); }