diff --git a/plugin/flv/pkg/record.go b/plugin/flv/pkg/record.go index 6e1b57a..037dcc0 100644 --- a/plugin/flv/pkg/record.go +++ b/plugin/flv/pkg/record.go @@ -153,6 +153,7 @@ var CustomFileName = func(job *m7s.RecordJob) string { } func (r *Recorder) createStream(start time.Time) (err error) { + r.RecordJob.RecConf.Type = "flv" return r.CreateStream(start, CustomFileName) } diff --git a/plugin/hls/pkg/record.go b/plugin/hls/pkg/record.go index cadd67a..fc405ad 100644 --- a/plugin/hls/pkg/record.go +++ b/plugin/hls/pkg/record.go @@ -35,6 +35,7 @@ var CustomFileName = func(job *m7s.RecordJob) string { } func (r *Recorder) createStream(start time.Time) (err error) { + r.RecordJob.RecConf.Type = "ts" return r.CreateStream(start, CustomFileName) } diff --git a/plugin/mp4/pkg/record.go b/plugin/mp4/pkg/record.go index d5776a8..7ede399 100644 --- a/plugin/mp4/pkg/record.go +++ b/plugin/mp4/pkg/record.go @@ -135,6 +135,9 @@ var CustomFileName = func(job *m7s.RecordJob) string { } func (r *Recorder) createStream(start time.Time) (err error) { + if r.RecordJob.RecConf.Type == "" { + r.RecordJob.RecConf.Type = "mp4" + } err = r.CreateStream(start, CustomFileName) if err != nil { return @@ -143,8 +146,7 @@ func (r *Recorder) createStream(start time.Time) (err error) { if err != nil { return } - if r.RecordJob.RecConf.Type == "fmp4" { - r.Event.Type = "fmp4" + if r.Event.Type == "fmp4" { r.muxer = NewMuxerWithStreamPath(FLAG_FRAGMENT, r.Event.StreamPath) } else { r.muxer = NewMuxerWithStreamPath(0, r.Event.StreamPath)