From 686fb374e960646a7c52a976289023534989ee9d Mon Sep 17 00:00:00 2001 From: Alex X Date: Sat, 18 May 2024 17:14:25 +0300 Subject: [PATCH] Remove PCMU for two way for DVRIP source #1111 --- pkg/dvrip/client.go | 2 +- pkg/dvrip/dvrip.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/dvrip/client.go b/pkg/dvrip/client.go index e698e7bf..0b485450 100644 --- a/pkg/dvrip/client.go +++ b/pkg/dvrip/client.go @@ -114,7 +114,7 @@ func (c *Client) Play() error { } func (c *Client) Talk() error { - format := `{"Name":"OPTalk","SessionID":"0x%08X","OPTalk":{"Action":"%s","AudioFormat":{"EncodeType":"G711_ALAW"}}}` + "\x0A\x00" + format := `{"Name":"OPTalk","SessionID":"0x%08X","OPTalk":{"Action":"%s","AudioFormat":{"EncodeType":"G711_ALAW"}}}` + "\x0A\x00" data := fmt.Sprintf(format, c.session, "Claim") if _, err := c.WriteCmd(OPTalkClaim, []byte(data)); err != nil { diff --git a/pkg/dvrip/dvrip.go b/pkg/dvrip/dvrip.go index 35823ccf..0f914640 100644 --- a/pkg/dvrip/dvrip.go +++ b/pkg/dvrip/dvrip.go @@ -23,8 +23,9 @@ func Dial(url string) (core.Producer, error) { Kind: core.KindAudio, Direction: core.DirectionSendonly, Codecs: []*core.Codec{ + // leave only one codec here for better compatibility with cameras + // https://github.com/AlexxIT/go2rtc/issues/1111 {Name: core.CodecPCMA, ClockRate: 8000, PayloadType: 8}, - {Name: core.CodecPCMU, ClockRate: 8000, PayloadType: 0}, }, }, }