Added support to stream backchannel to a command (outputbc)

This commit is contained in:
Michael Reif
2024-01-06 00:04:15 +01:00
parent ccec41a10f
commit f65b18842a
5 changed files with 143 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package outputbc
import (
"github.com/AlexxIT/go2rtc/internal/streams"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/outputbc"
"github.com/AlexxIT/go2rtc/pkg/shell"
)
func Init() {
streams.HandleFunc("outputbc", handle)
}
func handle(url string) (core.Producer, error) {
args := shell.QuoteSplit(url[9:])
con, err := outputbc.NewClient(args)
if err != nil {
return nil, err
}
con.Dial()
return con, nil
}