From 23494a9053944f9fa5c4310ef7bf51aa652049e2 Mon Sep 17 00:00:00 2001 From: Leon <8544842+leon14631@user.noreply.gitee.com> Date: Tue, 19 Jul 2022 12:13:46 +0000 Subject: [PATCH] update src/Record/MP4Recorder.cpp. --- src/Record/MP4Recorder.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Record/MP4Recorder.cpp b/src/Record/MP4Recorder.cpp index a572191d..d3ad5a69 100644 --- a/src/Record/MP4Recorder.cpp +++ b/src/Record/MP4Recorder.cpp @@ -118,12 +118,7 @@ bool MP4Recorder::inputFrame(const Frame::Ptr &frame) { } if (_muxer) { - if (_last_dts==0) - { - _last_dts = frame->dts(); - } - auto duration = frame->dts() - _last_dts; - _info.time_len = int(duration/1000); //记录上一帧 + _info.time_len = (float) (::time(NULL) - info.start_time); //生成mp4文件 return _muxer->inputFrame(frame); }