presence

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package presence keeps a battery camera present to a recorder without waking it. Its stream is made only from what reostream already has: the last picture, repeated while nothing happens; each motion clip the camera uploads, played in at real speed as it arrives; and the live picture whenever someone has woken the camera to watch it.

A recorder such as Frigate can then hold the stream open around the clock. Repeated identical pictures are no motion to it, and a clip is real motion, so its own detection runs on the footage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(p *Player)

Register makes p the player for its camera.

Types

type Player

type Player struct {
	// contains filtered or unexported fields
}

Player is one battery camera's presence stream.

func Lookup

func Lookup(camera string) *Player

Lookup returns camera's player, or nil.

func New

func New(camera string, sink Sink) *Player

New builds the player for camera, writing to sink.

func (*Player) Frame

func (p *Player) Frame(f baichuan.Frame)

Frame passes a live frame through (the camera is awake because someone is watching it), on the stream's own clock. It is the sink the camera's on-demand main stream writes to.

func (*Player) Play

func (p *Player) Play(path string)

Play queues a newly uploaded clip to be played into the stream.

func (*Player) Run

func (p *Player) Run(ctx context.Context)

Run repeats the still and plays queued clips until ctx ends.

func (*Player) Seed

func (p *Player) Seed(path string)

Seed takes the still from a clip already on disk, without playing it: the picture to show until the next clip or live view.

func (*Player) SeedFrame

func (p *Player) SeedFrame(codec string, es []byte)

SeedFrame takes the still from a keyframe reostream kept from the last time the camera was awake.

type Sink

type Sink interface {
	Frame(baichuan.Frame)
}

Sink receives the stream's frames: the camera's RTSP output.

Jump to

Keyboard shortcuts

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