player增加speed,pause扩展,seek支持秒级定位,MP4按时间戳生成文件

This commit is contained in:
baiyfcu
2021-08-09 18:28:43 +08:00
parent 9e5d325e43
commit 0ed902509a
25 changed files with 455 additions and 52 deletions

View File

@@ -107,12 +107,17 @@ void MP4Recorder::closeFile() {
}
void MP4Recorder::inputFrame(const Frame::Ptr &frame) {
if(!_muxer || ((_createFileTicker.elapsedTime() > _max_second * 1000) &&
if (_baseSec == 0)
_baseSec = frame->dts();
auto dis = frame->dts() - _baseSec;
if(!_muxer || ((dis > _max_second * 1000) &&
(!_haveVideo || (_haveVideo && frame->keyFrame()))) ){
//成立条件
//1、_muxer为空
//2、到了切片时间并且只有音频
//3、到了切片时间有视频并且遇到视频的关键帧
DebugL << "create file dts:" << frame->dts() << " baseSec:" << _baseSec;
_baseSec = 0;
createFile();
}