webrtc: start/stop ffmpeg procees if webrtc has clients

This commit is contained in:
Artem
2024-11-05 23:49:26 +01:00
parent c228921237
commit c5f77df6b0
2 changed files with 11 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ func main() {
log.Println("Failed to parse log level, use default level: info")
}
webrtc, err := rtc.InitListener(cfg.WebRtc.Host, cfg.WebRtc.VideoPort, 5006)
webrtc, err := rtc.InitListener(cfg.WebRtc.Host, cfg.WebRtc.VideoPort, cfg.WebRtc.AudioPort)
if err != nil {
log.Fatal(err)
}
@@ -44,8 +44,7 @@ func main() {
ustreamer.Start()
//go ustreamer.Watch()
} else if cfg.Stream.Source == config.StreamSourceH264 {
v := ffmpeg.InitFFmpeg()
v.Start()
ffmpeg.InitFFmpeg()
} else {
log.Fatalf("unsupported stream source type: %v", cfg.Stream.Source)
}