second forcepush this away if i fail

This commit is contained in:
Soph :3 2025-11-24 20:41:43 +02:00
parent d1f1aae0d3
commit 9e5cd110e0
3 changed files with 201 additions and 316 deletions

View file

@ -55,7 +55,7 @@ func main() {
Args: cobra.MaximumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
defer camera.Disconnect()
relay := libipcamera.CreateRTPRelay(applicationContext, net.ParseIP("127.0.0.1"), 5220)
relay := libipcamera.CreateRTPRelay(applicationContext)
defer relay.Stop()
camera.StartPreviewStream()
@ -271,10 +271,15 @@ func main() {
if(host == "") {
host = "127.0.0.1"
}
rtspServer, err := rtsp.CreateServer(applicationContext, host, port, camera)
relay := libipcamera.CreateRTPRelay(applicationContext)
rtspServer, err := rtsp.CreateServer(applicationContext, host, port, relay)
defer rtspServer.Close()
if err := camera.StartPreviewStream(); err != nil {
log.Printf("ERROR preview: %v", err)
return
}
log.Printf("Created RTSP Server\n")
if err != nil {