configuration

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfiguration

type APIConfiguration struct {
	Enabled bool   `json:"enabled" toml:"enabled"`
	Host    string `json:"host" toml:"host"`
	Port    int32  `json:"port" toml:"port"`
	// 'release' or 'debug' for GIN
	Mode    string `json:"mode" toml:"mode"`
	Verbose string `json:"verbose" toml:"verbose"`
}

APIConfiguration is needed for configuring REST API part

type ArchiveConfiguration added in v0.5.0

type ArchiveConfiguration struct {
	Recording    bool          `json:"recording" toml:"recording"`
	Serving      bool          `json:"serving" toml:"serving"`
	MsPerSegment int64         `json:"ms_per_file" toml:"ms_per_file"`
	Directory    string        `json:"directory" toml:"directory"`
	Minio        MinioSettings `json:"minio_settings" toml:"minio_settings"`
}

ArchiveConfiguration is a archive configuration for every stream with enabled archive option

type CORSConfiguration

type CORSConfiguration struct {
	Enabled          bool     `json:"enabled" toml:"enabled"`
	AllowOrigins     []string `json:"allow_origins" toml:"allow_origins"`
	AllowMethods     []string `json:"allow_methods" toml:"allow_methods"`
	AllowHeaders     []string `json:"allow_headers" toml:"allow_headers"`
	ExposeHeaders    []string `json:"expose_headers" toml:"expose_headers"`
	AllowCredentials bool     `json:"allow_credentials" toml:"allow_credentials"`
}

CORSConfiguration is settings for CORS

type Configuration

type Configuration struct {
	APICfg         APIConfiguration            `json:"api" toml:"api"`
	VideoServerCfg VideoConfiguration          `json:"video" toml:"video"`
	HLSCfg         HLSConfiguration            `json:"hls" toml:"hls"`
	ArchiveCfg     ArchiveConfiguration        `json:"archive" toml:"archive"`
	CorsConfig     CORSConfiguration           `json:"cors" toml:"cors"`
	RTSPStreams    []SingleStreamConfiguration `json:"rtsp_streams" toml:"rtsp_streams"`
	LocalFiles     []LocalFileConfiguration    `json:"local_files" toml:"local_files"`
}

Configuration represents user defined settings for video server

func PrepareConfiguration

func PrepareConfiguration(confName string) (*Configuration, error)

func PrepareConfigurationJSON added in v0.6.0

func PrepareConfigurationJSON(fname string) (*Configuration, error)

func PrepareConfigurationTOML added in v0.6.0

func PrepareConfigurationTOML(fname string) (*Configuration, error)

type HLSConfiguration

type HLSConfiguration struct {
	MsPerSegment int64  `json:"ms_per_segment" toml:"ms_per_segment"`
	Directory    string `json:"directory" toml:"directory"`
	WindowSize   uint   `json:"window_size" toml:"window_size"`
	Capacity     uint   `json:"window_capacity" toml:"window_capacity"`
}

HLSConfiguration is a HLS configuration for every stream with provided "hls" type in 'output_types' field of 'rtsp_streams' objects

type LocalFileConfiguration added in v0.7.0

type LocalFileConfiguration struct {
	GUID        string   `json:"guid" toml:"guid"`
	File        string   `json:"file" toml:"file"`
	OutputTypes []string `json:"output_types" toml:"output_types"`
	Loop        bool     `json:"loop" toml:"loop"`
	Verbose     string   `json:"verbose" toml:"verbose"`
	// NOTE: Archiving a local file is mostly useless since the source is already a file.
	Archive StreamArchiveConfiguration `json:"archive" toml:"archive"`
}

LocalFileConfiguration is needed for configuring local file streams

type MinioSettings added in v0.5.0

type MinioSettings struct {
	Host          string `json:"host" toml:"host"`
	Port          int32  `json:"port" toml:"port"`
	User          string `json:"user" toml:"user"`
	Password      string `json:"password" toml:"password"`
	DefaultBucket string `json:"default_bucket" toml:"default_bucket"`
	DefaultPath   string `json:"default_path" toml:"default_path"`
}

MinioSettings

func (*MinioSettings) String added in v0.5.0

func (ms *MinioSettings) String() string

type SingleStreamConfiguration

type SingleStreamConfiguration struct {
	GUID        string                     `json:"guid" toml:"guid"`
	URL         string                     `json:"url" toml:"url"`
	Type        string                     `json:"type" toml:"type"`
	OutputTypes []string                   `json:"output_types" toml:"output_types"`
	Archive     StreamArchiveConfiguration `json:"archive" toml:"archive"`
	// Level of verbose. Pick 'v' or 'vvv' (or leave it empty)
	Verbose string `json:"verbose" toml:"verbose"`
}

SingleStreamConfiguration is needed for configuring certain RTSP stream

type StreamArchiveConfiguration added in v0.5.0

type StreamArchiveConfiguration struct {
	Recording    bool   `json:"recording" toml:"recording"`
	MsPerSegment int64  `json:"ms_per_file" toml:"ms_per_file"`
	Directory    string `json:"directory" toml:"directory"`
	TypeArchive  string `json:"type" toml:"type"`
	MinioBucket  string `json:"minio_bucket" toml:"minio_bucket"`
	MinioPath    string `json:"minio_path" toml:"minio_path"`
}

StreamArchiveConfiguration is a archive configuration for specific stream. It can overwrite parent archive options if needed

type VideoConfiguration

type VideoConfiguration struct {
	Host string `json:"host" toml:"host"`
	Port int32  `json:"port" toml:"port"`
	// 'release' or 'debug' for GIN
	Mode    string `json:"mode" toml:"mode"`
	Verbose string `json:"verbose" toml:"verbose"`
}

VideoConfiguration is needed for configuring actual video server part

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL