新增媒体流flush机制:#1996

This commit is contained in:
ziyue
2022-10-16 19:49:56 +08:00
parent 80eef693c6
commit ac1abb34da
44 changed files with 287 additions and 124 deletions

View File

@@ -33,6 +33,7 @@ MP4Recorder::MP4Recorder(const string &path, const string &vhost, const string &
}
MP4Recorder::~MP4Recorder() {
flush();
closeFile();
}
@@ -96,6 +97,12 @@ void MP4Recorder::closeFile() {
}
}
void MP4Recorder::flush() {
if (_muxer) {
_muxer->flush();
}
}
bool MP4Recorder::inputFrame(const Frame::Ptr &frame) {
if (!(_have_video && frame->getTrackType() == TrackAudio)) {
//如果有视频且输入的是音频,那么应该忽略切片逻辑