Compare commits

...

6 Commits

Author SHA1 Message Date
Cedric Verstraeten
4c413012a4 [release] v3.1.7 2024-01-16 13:02:41 +01:00
Cedric Verstraeten
74ea2f6cdd hot-fix: make sure webrtc candidates are assigned to the correct session 2024-01-16 12:55:31 +01:00
Cedric Verstraeten
2a7d9b62d4 warning: printing the work sub url 2024-01-16 10:49:40 +01:00
Cedric Verstraeten
21d81b94dd [release] v3.1.6 2024-01-16 09:47:07 +01:00
Cedric Verstraeten
091662ff26 hot-fix: support avigilon backchannel 2024-01-16 09:39:34 +01:00
Cedric Verstraeten
803e8f55ef correct webrtc audio buffer duration 2024-01-14 21:37:58 +01:00
6 changed files with 22 additions and 11 deletions

View File

@@ -9,7 +9,7 @@ go 1.20
require (
github.com/InVisionApp/conjungo v1.1.0
github.com/appleboy/gin-jwt/v2 v2.9.1
github.com/bluenviron/gortsplib/v4 v4.6.3
github.com/bluenviron/gortsplib/v4 v4.7.1
github.com/bluenviron/mediacommon v1.7.1
github.com/cedricve/go-onvif v0.0.0-20200222191200-567e8ce298f6
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5

View File

@@ -64,8 +64,8 @@ github.com/appleboy/gofight/v2 v2.1.2 h1:VOy3jow4vIK8BRQJoC/I9muxyYlJ2yb9ht2hZoS
github.com/appleboy/gofight/v2 v2.1.2/go.mod h1:frW+U1QZEdDgixycTj4CygQ48yLTUhplt43+Wczp3rw=
github.com/beevik/etree v1.3.0 h1:hQTc+pylzIKDb23yYprodCWWTt+ojFfUZyzU09a/hmU=
github.com/beevik/etree v1.3.0/go.mod h1:aiPf89g/1k3AShMVAzriilpcE4R/Vuor90y83zVZWFc=
github.com/bluenviron/gortsplib/v4 v4.6.3 h1:/FgUhxe/DGFkmwHNGNnw7NhcuZeSwnxCzYHDbyAtMjo=
github.com/bluenviron/gortsplib/v4 v4.6.3/go.mod h1:UqdkRR5YvKHP/wHEQQySJFKJm6tIZcftdP7cNszIZ1g=
github.com/bluenviron/gortsplib/v4 v4.7.1 h1:ZiPHjnIsdPDfPGZgfBr2n2xCFZlvmc/5zEqdoJUa1vU=
github.com/bluenviron/gortsplib/v4 v4.7.1/go.mod h1:3+IYh85PgIPLHr4D5z7GnRvpu/ogSHMDhsYW/CjrD8E=
github.com/bluenviron/mediacommon v1.7.1 h1:7Lm2b8M9gUk3Ben1w+OPwadAeYseIBscwgdiL+aLtfw=
github.com/bluenviron/mediacommon v1.7.1/go.mod h1:Ij/kE1LEucSjryNBVTyPL/gBI0d6/Css3f5PyrM957w=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=

View File

@@ -25,7 +25,6 @@ import (
"github.com/bluenviron/gortsplib/v4/pkg/format/rtph265"
"github.com/bluenviron/gortsplib/v4/pkg/format/rtplpcm"
"github.com/bluenviron/gortsplib/v4/pkg/format/rtpmpeg4audio"
"github.com/bluenviron/gortsplib/v4/pkg/format/rtpsimpleaudio"
"github.com/bluenviron/mediacommon/pkg/codecs/h264"
"github.com/bluenviron/mediacommon/pkg/codecs/h265"
"github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio"
@@ -63,7 +62,7 @@ type Golibrtsp struct {
AudioG711Index int8
AudioG711Media *description.Media
AudioG711Forma *format.G711
AudioG711Decoder *rtpsimpleaudio.Decoder
AudioG711Decoder *rtplpcm.Decoder
HasBackChannel bool
AudioG711IndexBackChannel int8

View File

@@ -188,7 +188,7 @@ func RunAgent(configDirectory string, configuration *models.Configuration, commu
time.Sleep(time.Second * 3)
return status
}
log.Log.Info("components.Kerberos.RunAgent(): opened RTSP sub stream: " + rtspUrl)
log.Log.Info("components.Kerberos.RunAgent(): opened RTSP sub stream: " + subRtspUrl)
// Get the video streams from the RTSP server.
videoSubStreams, err = rtspSubClient.GetVideoStreams()

View File

@@ -222,6 +222,8 @@ func InitializeWebRTCConnection(configuration *models.Configuration, communicati
candateBinary, err := json.Marshal(candateJSON)
if err == nil {
valueMap["candidate"] = string(candateBinary)
valueMap["sdp"] = []byte(base64.StdEncoding.EncodeToString([]byte(answer.SDP)))
valueMap["session_id"] = handshake.SessionID
} else {
log.Log.Info("webrtc.main.InitializeWebRTCConnection(): something went wrong while marshalling candidate: " + err.Error())
}
@@ -250,6 +252,7 @@ func InitializeWebRTCConnection(configuration *models.Configuration, communicati
// Create a config map
valueMap := make(map[string]interface{})
valueMap["sdp"] = []byte(base64.StdEncoding.EncodeToString([]byte(answer.SDP)))
valueMap["session_id"] = handshake.SessionID
log.Log.Info("webrtc.main.InitializeWebRTCConnection(): Send SDP answer")
// We'll send the candidate to the hub
@@ -326,7 +329,8 @@ func WriteToTrack(livestreamCursor *packets.QueueCursor, configuration *models.C
var cursorError error
var pkt packets.Packet
var previousTime time.Duration
var previousTimeVideo time.Duration
var previousTimeAudio time.Duration
start := false
receivedKeyFrame := false
@@ -336,8 +340,6 @@ func WriteToTrack(livestreamCursor *packets.QueueCursor, configuration *models.C
for cursorError == nil {
pkt, cursorError = livestreamCursor.ReadPacket()
bufferDuration := pkt.Time - previousTime
previousTime = pkt.Time
if config.Capture.ForwardWebRTC != "true" && peerConnectionCount == 0 {
start = false
@@ -385,6 +387,11 @@ func WriteToTrack(livestreamCursor *packets.QueueCursor, configuration *models.C
//}
if pkt.IsVideo {
// Calculate the difference
bufferDuration := pkt.Time - previousTimeVideo
previousTimeVideo = pkt.Time
// Start at the first keyframe
if pkt.IsKeyFrame {
start = true
@@ -401,8 +408,13 @@ func WriteToTrack(livestreamCursor *packets.QueueCursor, configuration *models.C
}
}
} else if pkt.IsAudio {
// Calculate the difference
bufferDuration := pkt.Time - previousTimeAudio
previousTimeAudio = pkt.Time
// We will send the audio
sample := pionMedia.Sample{Data: pkt.Data, Duration: pkt.Time}
sample := pionMedia.Sample{Data: pkt.Data, Duration: bufferDuration}
if err := audioTrack.WriteSample(sample); err != nil && err != io.ErrClosedPipe {
log.Log.Error("webrtc.main.WriteToTrack(): something went wrong while writing sample: " + err.Error())
}

View File

@@ -100,7 +100,7 @@ class App extends React.Component {
</div>
)}
<div id="page-root">
<Sidebar logo={logo} title="Kerberos Agent" version="v3.1.5" mobile>
<Sidebar logo={logo} title="Kerberos Agent" version="v3.1.7" mobile>
<Profilebar
username={username}
email="support@kerberos.io"