mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
Add config for save fmp4 record files (#3356)
This commit is contained in:
parent
78a6f041a8
commit
03c93d0b23
@ -277,6 +277,8 @@ sampleMS=500
|
||||
fastStart=0
|
||||
#MP4点播(rtsp/rtmp/http-flv/ws-flv)是否循环播放文件
|
||||
fileRepeat=0
|
||||
#MP4录制写文件格式是否采用fmp4,启用的话,断电未完成录制的文件也能正常打开
|
||||
enableFmp4=0
|
||||
|
||||
[rtmp]
|
||||
#rtmp必须在此时间内完成握手,否则服务器会断开链接,单位秒
|
||||
|
@ -297,6 +297,7 @@ const string kSampleMS = RECORD_FIELD "sampleMS";
|
||||
const string kFileBufSize = RECORD_FIELD "fileBufSize";
|
||||
const string kFastStart = RECORD_FIELD "fastStart";
|
||||
const string kFileRepeat = RECORD_FIELD "fileRepeat";
|
||||
const string kEnableFmp4 = RECORD_FIELD "enableFmp4";
|
||||
|
||||
static onceToken token([]() {
|
||||
mINI::Instance()[kAppName] = "record";
|
||||
@ -304,6 +305,7 @@ static onceToken token([]() {
|
||||
mINI::Instance()[kFileBufSize] = 64 * 1024;
|
||||
mINI::Instance()[kFastStart] = false;
|
||||
mINI::Instance()[kFileRepeat] = false;
|
||||
mINI::Instance()[kEnableFmp4] = false;
|
||||
});
|
||||
} // namespace Record
|
||||
|
||||
|
@ -354,6 +354,8 @@ extern const std::string kFileBufSize;
|
||||
extern const std::string kFastStart;
|
||||
// mp4文件是否重头循环读取
|
||||
extern const std::string kFileRepeat;
|
||||
// mp4录制文件是否采用fmp4格式
|
||||
extern const std::string kEnableFmp4;
|
||||
} // namespace Record
|
||||
|
||||
////////////HLS相关配置///////////
|
||||
|
@ -31,7 +31,8 @@ void MP4Muxer::openMP4(const string &file) {
|
||||
|
||||
MP4FileIO::Writer MP4Muxer::createWriter() {
|
||||
GET_CONFIG(bool, mp4FastStart, Record::kFastStart);
|
||||
return _mp4_file->createWriter(mp4FastStart ? MOV_FLAG_FASTSTART : 0, false);
|
||||
GET_CONFIG(bool, recordEnableFmp4, Record::kEnableFmp4);
|
||||
return _mp4_file->createWriter(mp4FastStart ? MOV_FLAG_FASTSTART : 0, recordEnableFmp4);
|
||||
}
|
||||
|
||||
void MP4Muxer::closeMP4() {
|
||||
|
Loading…
Reference in New Issue
Block a user