1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-29 15:51:01 +02:00

Use channels to send SRT packets to forwarded streams

This commit is contained in:
Yohann D'ANELLO
2020-10-01 12:00:59 +02:00
parent dc7a3fef9f
commit efa44488c0
5 changed files with 54 additions and 21 deletions

View File

@ -52,11 +52,14 @@ func TestForwardStream(t *testing.T) {
forwardingList := make(map[string][]string)
forwardingList["demo"] = []string{"rtmp://127.0.0.1:1936/live/app"}
forwardingChannel = make(chan srt.Packet)
// Register forwarding stream list
New(forwardingList)
New(forwardingList, forwardingChannel)
// Serve HTTP Server
go srt.Serve(&srt.Options{ListenAddress: ":9711", MaxClients: 2})
go srt.Serve(&srt.Options{ListenAddress: ":9711", MaxClients: 2}, forwardingChannel)
ffmpeg := exec.Command("ffmpeg",
"-i", "http://ftp.crans.org/events/Blender%20OpenMovies/big_buck_bunny_480p_stereo.ogg",