app

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 15 Imported by: 0

README

  • By default go2rtc will search config file go2rtc.yaml in current work directory
  • go2rtc support multiple config files:
    • go2rtc -c config1.yaml -c config2.yaml -c config3.yaml
  • go2rtc support inline config as multiple formats from command line:
    • YAML: go2rtc -c '{log: {format: text}}'
    • JSON: go2rtc -c '{"log":{"format":"text"}}'
    • key=value: go2rtc -c log.format=text
  • Every next config will overwrite previous (but only defined params)
go2rtc -config "{log: {format: text}}" -config /config/go2rtc.yaml -config "{rtsp: {listen: ''}}" -config /usr/local/go2rtc/go2rtc.yaml

or simple version

go2rtc -c log.format=text -c /config/go2rtc.yaml -c rtsp.listen='' -c /usr/local/go2rtc/go2rtc.yaml

Environment variables

There is support for loading external variables into the config. First, they will be attempted to be loaded from credential files. If CREDENTIALS_DIRECTORY is not set, then the key will be loaded from an environment variable. If no environment variable is set, then the string will be left as-is.

streams:
  camera1: rtsp://rtsp:${CAMERA_PASSWORD}@192.168.1.123/av_stream/ch0

rtsp:
  username: ${RTSP_USER:admin}   # "admin" if "RTSP_USER" not set
  password: ${RTSP_PASS:secret}  # "secret" if "RTSP_PASS" not set

JSON Schema

Editors like GoLand and VS Code supports autocomplete and syntax validation.

# yaml-language-server: $schema=https://raw.githubusercontent.com/AlexxIT/go2rtc/master/website/schema.json

Defaults

  • Default values may change in updates
  • FFmpeg module has many presets, they are not listed here because they may also change in updates
api:
  listen: ":1984"

ffmpeg:
  bin: "ffmpeg"

log:
  format: "color"
  level: "info"
  output: "stdout"
  time: "UNIXMS"

rtsp:
  listen: ":8554"
  default_query: "video&audio"

srtp:
  listen: ":8443"

webrtc:
  listen: ":8555/tcp"
  ice_servers:
    - urls: [ "stun:stun.l.google.com:19302" ]

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version    string
	UserAgent  string
	ConfigPath string
	Info       = make(map[string]any)
)
View Source
var MemoryLog = newBuffer()

Functions

func GetLogger

func GetLogger(module string) zerolog.Logger

func Init

func Init()

func LoadConfig

func LoadConfig(v any)

func PatchConfig added in v1.7.0

func PatchConfig(path []string, value any) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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