diff --git a/cmd/hc-camera-ffmpeg/main.go b/cmd/hc-camera-ffmpeg/main.go index 5f65798..3af561a 100644 --- a/cmd/hc-camera-ffmpeg/main.go +++ b/cmd/hc-camera-ffmpeg/main.go @@ -89,17 +89,6 @@ func main() { cameraAcc, snapshotFunc := camera.CreateCamera(cameraInfo, inputCfg, encProfile) - t, err := hc.NewIPTransport(hcConfig, cameraAcc.Accessory) - if err != nil { - log.Fatal(err) - } - - t.CameraSnapshotReq = snapshotFunc - - hc.OnTermination(func() { - <-t.Stop() - }) - if *doorbell { var doorbellService = service.NewDoorbell() cameraAcc.AddService(doorbellService.Service) @@ -122,5 +111,16 @@ func main() { } + t, err := hc.NewIPTransport(hcConfig, cameraAcc.Accessory) + if err != nil { + log.Fatal(err) + } + + t.CameraSnapshotReq = snapshotFunc + + hc.OnTermination(func() { + <-t.Stop() + }) + t.Start() }