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 RedisConfig
- type VideoFileInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRecordExist = errors.New("recorder exist")
View Source
var RecordPluginConfig = &RecordConfig{ DefaultYaml: defaultYaml, 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: ".", }, Redis: nil, }
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 //文件扩展名 Path string //存储文件的目录 AutoRecord bool Filter string Fragment time.Duration //分片大小,0表示不分片 CreateFileFn func(filename string, append bool) (FileWr, error) `json:"-" yaml:"-"` GetDurationFn func(file io.ReadSeeker) uint32 `json:"-" yaml:"-"` // contains filtered or unexported fields }
func (*Record) NeedRecord ¶
type RecordConfig ¶
type RecordConfig struct { DefaultYaml config.Subscribe Flv Record Mp4 Record Fmp4 Record Hls Record Raw Record RawAudio Record RedisConf RedisConfig Redis *redis.Client `yaml:"-"` // 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 SkipTS uint32 Record `json:"-" yaml:"-"` File FileWr `json:"-" yaml:"-"` FileName string // 自定义文件名,分段录像无效 // contains filtered or unexported fields }
func (*Recorder) CreateFile ¶
func (*Recorder) GetRecorder ¶
type RedisConfig ¶ added in v1.0.7
type VideoFileInfo ¶
Click to show internal directories.
Click to hide internal directories.