Documentation
¶
Index ¶
- Variables
- type FLVRecorder
- type FMP4Recorder
- type FileWr
- type FileWriter
- type HLSRecorder
- type IRecorder
- type MP4Recorder
- type RawRecorder
- type Record
- type RecordConfig
- func (conf *RecordConfig) API_list(w http.ResponseWriter, r *http.Request)
- func (conf *RecordConfig) API_list_recording(w http.ResponseWriter, r *http.Request)
- func (conf *RecordConfig) API_start(w http.ResponseWriter, r *http.Request)
- func (conf *RecordConfig) API_stop(w http.ResponseWriter, r *http.Request)
- func (conf *RecordConfig) OnEvent(event any)
- func (conf *RecordConfig) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type Recorder
- type StorageConfig
- type VideoFileInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRecordExist = errors.New("recorder exist")
View Source
var RecordPluginConfig = &RecordConfig{ Flv: Record{ Path: "record/flv", Ext: ".flv", GetDurationFn: getFLVDuration, }, Fmp4: Record{ Path: "record/fmp4", Ext: ".mp4", }, Mp4: Record{ Path: "record/mp4", Ext: ".mp4", }, Hls: Record{ Path: "record/hls", Ext: ".m3u8", }, Raw: Record{ Path: "record/raw", Ext: ".", }, RawAudio: Record{ Path: "record/raw", Ext: ".", }, }
View Source
var WritingFiles sync.Map
Functions ¶
This section is empty.
Types ¶
type FLVRecorder ¶
func NewFLVRecorder ¶
func NewFLVRecorder() (r *FLVRecorder)
func (*FLVRecorder) Close ¶
func (r *FLVRecorder) Close() error
func (*FLVRecorder) OnEvent ¶
func (r *FLVRecorder) OnEvent(event any)
func (*FLVRecorder) Start ¶
func (r *FLVRecorder) Start(streamPath string) (err error)
type FMP4Recorder ¶
type FMP4Recorder struct {
Recorder
// contains filtered or unexported fields
}
func NewFMP4Recorder ¶
func NewFMP4Recorder() *FMP4Recorder
func (*FMP4Recorder) Close ¶
func (r *FMP4Recorder) Close() error
func (*FMP4Recorder) OnEvent ¶
func (r *FMP4Recorder) OnEvent(event any)
func (*FMP4Recorder) Start ¶
func (r *FMP4Recorder) Start(streamPath string) (err error)
type FileWriter ¶
type FileWriter struct {
io.Reader
io.Writer
io.Seeker
io.Closer
// contains filtered or unexported fields
}
func (*FileWriter) Close ¶
func (f *FileWriter) Close() error
type HLSRecorder ¶
type HLSRecorder struct {
Recorder
MemoryTs
// contains filtered or unexported fields
}
func NewHLSRecorder ¶
func NewHLSRecorder() (r *HLSRecorder)
func (*HLSRecorder) Close ¶
func (r *HLSRecorder) Close() (err error)
func (*HLSRecorder) CreateFile ¶
func (h *HLSRecorder) CreateFile() (fw FileWr, err error)
创建一个新的ts文件
func (*HLSRecorder) OnEvent ¶
func (h *HLSRecorder) OnEvent(event any)
func (*HLSRecorder) Start ¶
func (h *HLSRecorder) Start(streamPath string) error
type MP4Recorder ¶
type MP4Recorder struct {
Recorder
*mp4.Movmuxer `json:"-" yaml:"-"`
// contains filtered or unexported fields
}
func NewMP4Recorder ¶
func NewMP4Recorder() *MP4Recorder
func (*MP4Recorder) Close ¶
func (r *MP4Recorder) Close() (err error)
func (*MP4Recorder) OnEvent ¶
func (r *MP4Recorder) OnEvent(event any)
func (*MP4Recorder) Start ¶
func (r *MP4Recorder) Start(streamPath string) (err error)
type RawRecorder ¶
func NewRawAudioRecorder ¶
func NewRawAudioRecorder() (r *RawRecorder)
func NewRawRecorder ¶
func NewRawRecorder() (r *RawRecorder)
func (*RawRecorder) Close ¶
func (r *RawRecorder) Close() (err error)
func (*RawRecorder) OnEvent ¶
func (r *RawRecorder) OnEvent(event any)
func (*RawRecorder) Start ¶
func (r *RawRecorder) Start(streamPath string) error
type Record ¶
type Record struct {
Ext string `desc:"文件扩展名"` //文件扩展名
Path string `desc:"存储文件的目录"` //存储文件的目录
AutoRecord bool `desc:"是否自动录制"` //是否自动录制
Filter config.Regexp `desc:"录制过滤器"` //录制过滤器
Fragment time.Duration `desc:"分片大小,0表示不分片"` //分片大小,0表示不分片
http.Handler `json:"-" yaml:"-"`
CreateFileFn func(filename string, append bool) (FileWr, error) `json:"-" yaml:"-"`
GetDurationFn func(file io.ReadSeeker) uint32 `json:"-" yaml:"-"`
}
func (*Record) NeedRecord ¶
type RecordConfig ¶
type RecordConfig struct {
config.Subscribe
Flv Record `desc:"flv录制配置"`
Mp4 Record `desc:"mp4录制配置"`
Fmp4 Record `desc:"fmp4录制配置"`
Hls Record `desc:"hls录制配置"`
Raw Record `desc:"视频裸流录制配置"`
RawAudio Record `desc:"音频裸流录制配置"`
Storage StorageConfig `desc:"MINIO 配置"`
// contains filtered or unexported fields
}
func (*RecordConfig) API_list ¶
func (conf *RecordConfig) API_list(w http.ResponseWriter, r *http.Request)
func (*RecordConfig) API_list_recording ¶
func (conf *RecordConfig) API_list_recording(w http.ResponseWriter, r *http.Request)
func (*RecordConfig) API_start ¶
func (conf *RecordConfig) API_start(w http.ResponseWriter, r *http.Request)
func (*RecordConfig) API_stop ¶
func (conf *RecordConfig) API_stop(w http.ResponseWriter, r *http.Request)
func (*RecordConfig) OnEvent ¶
func (conf *RecordConfig) OnEvent(event any)
func (*RecordConfig) ServeHTTP ¶
func (conf *RecordConfig) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Recorder ¶
type Recorder struct {
Subscriber
Storage StorageConfig
SkipTS uint32
Record `json:"-" yaml:"-"`
File FileWr `json:"-" yaml:"-"`
FileName string // 自定义文件名,分段录像无效
// contains filtered or unexported fields
}
func (*Recorder) CreateFile ¶
func (*Recorder) GetRecorder ¶
func (*Recorder) UploadFile ¶ added in v4.4.8
type StorageConfig ¶ added in v4.4.8
type VideoFileInfo ¶
Click to show internal directories.
Click to hide internal directories.