From cbe6a00d1aa94ed7cac81965063562cfcb31c965 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Mon, 5 Oct 2020 11:08:22 +0200 Subject: [PATCH] Reduce verbosity of streaming --- stream/webrtc/ingest.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/stream/webrtc/ingest.go b/stream/webrtc/ingest.go index 018c64e..8c6d229 100644 --- a/stream/webrtc/ingest.go +++ b/stream/webrtc/ingest.go @@ -2,7 +2,6 @@ package webrtc import ( "bufio" - "fmt" "io" "log" "net" @@ -43,14 +42,12 @@ func ingestFrom(inputChannel chan srt.Packet) { } }() - ffmpeg = exec.Command("ffmpeg", "-re", "-i", "pipe:0", + ffmpeg = exec.Command("ffmpeg", "-hide_banner", "-loglevel", "error", "-re", "-i", "pipe:0", "-an", "-vcodec", "libvpx", //"-cpu-used", "5", "-deadline", "1", "-g", "10", "-error-resilient", "1", "-auto-alt-ref", "1", "-f", "rtp", "rtp://127.0.0.1:5004", "-vn", "-acodec", "libopus", //"-cpu-used", "5", "-deadline", "1", "-g", "10", "-error-resilient", "1", "-auto-alt-ref", "1", "-f", "rtp", "rtp://127.0.0.1:5005") - fmt.Println("Waiting for RTP Packets, please run GStreamer or ffmpeg now") - input, err := ffmpeg.StdinPipe() if err != nil { panic(err) @@ -77,7 +74,6 @@ func ingestFrom(inputChannel chan srt.Packet) { if err := packet.Unmarshal(inboundRTPPacket[:n]); err != nil { panic(err) } - log.Printf("[Video] %s", packet) // Write RTP packet to all video tracks // Adapt payload and SSRC to match destination @@ -103,7 +99,9 @@ func ingestFrom(inputChannel chan srt.Packet) { if err := packet.Unmarshal(inboundRTPPacket[:n]); err != nil { panic(err) } - log.Printf("[Audio] %s", packet) + + // Write RTP packet to all audio tracks + // Adapt payload and SSRC to match destination for _, audioTrack := range audioTracks { packet.Header.PayloadType = audioTrack.PayloadType() packet.Header.SSRC = audioTrack.SSRC()