diff --git a/revid/raspivid.go b/revid/raspivid.go index f5ff0e75..d28f521f 100644 --- a/revid/raspivid.go +++ b/revid/raspivid.go @@ -213,3 +213,14 @@ func (r *Raspivid) Start() error { func (r *Raspivid) Read(p []byte) (int, error) { return r.out.Read(p) } + +func (r *Raspivid) Stop() error { + if r.cmd == nil || r.cmd.Process == nil { + return errors.New("raspivid process was never started") + } + err := r.cmd.Process.Kill() + if err != nil { + return fmt.Errorf("could not kill raspivid process: %w", err) + } + return nil +}