Compare commits

...

4 Commits

Author SHA1 Message Date
Cedric Verstraeten
d836e89e7f upgrade to v3.3.3 2025-02-05 20:55:08 +01:00
Cédric Verstraeten
53a52b3594 Merge pull request #162 from kerberos-io/fix/webrtc-sample-duration
fix / revert to old webrtc sample format (duration instead of packettimestamp)
2025-02-05 20:54:18 +01:00
Cedric Verstraeten
ba6ce25b21 revert to old webrtc sample format (duration instead of packettimestamp) 2025-02-05 20:50:57 +01:00
Cedric Verstraeten
8c9e18475f Update README.md 2025-01-31 16:35:11 +01:00
3 changed files with 14 additions and 12 deletions

View File

@@ -413,7 +413,7 @@ Read more about this [at the FAQ](#faq) below.
## Contributors
This project exists thanks to all the people who contribute.
This project exists thanks to all the people who contribute. Bravo!
<a href="https://github.com/kerberos-io/agent/graphs/contributors">
<img src="https://contrib.rocks/image?repo=kerberos-io/agent" />

View File

@@ -23,7 +23,7 @@ import (
"github.com/kerberos-io/agent/machinery/src/models"
)
const VERSION = "3.3.1"
const VERSION = "3.3.3"
const letterBytes = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"

View File

@@ -341,8 +341,8 @@ func WriteToTrack(livestreamCursor *packets.QueueCursor, configuration *models.C
var cursorError error
var pkt packets.Packet
//var previousTimeVideo int64
//var previousTimeAudio int64
var previousTimeVideo int64
var previousTimeAudio int64
start := false
receivedKeyFrame := false
@@ -401,16 +401,17 @@ func WriteToTrack(livestreamCursor *packets.QueueCursor, configuration *models.C
if pkt.IsVideo {
// Calculate the difference
//bufferDuration := pkt.Time - previousTimeVideo
//previousTimeVideo = pkt.Time
bufferDuration := pkt.Time - previousTimeVideo
previousTimeVideo = pkt.Time
// Start at the first keyframe
if pkt.IsKeyFrame {
start = true
}
if start {
//bufferDurationCasted := time.Duration(bufferDuration) * time.Millisecond
sample := pionMedia.Sample{Data: pkt.Data, PacketTimestamp: uint32(pkt.Time)}
bufferDurationCasted := time.Duration(bufferDuration) * time.Millisecond
sample := pionMedia.Sample{Data: pkt.Data, Duration: bufferDurationCasted}
//sample = pionMedia.Sample{Data: pkt.Data, Duration: time.Second}
if config.Capture.ForwardWebRTC == "true" {
// We will send the video to a remote peer
// TODO..
@@ -433,12 +434,13 @@ func WriteToTrack(livestreamCursor *packets.QueueCursor, configuration *models.C
}
// Calculate the difference
//bufferDuration := pkt.Time - previousTimeAudio
//previousTimeAudio = pkt.Time
bufferDuration := pkt.Time - previousTimeAudio
previousTimeAudio = pkt.Time
// We will send the audio
//bufferDurationCasted := time.Duration(bufferDuration) * time.Millisecond
sample := pionMedia.Sample{Data: pkt.Data, PacketTimestamp: uint32(pkt.Time)}
bufferDurationCasted := time.Duration(bufferDuration) * time.Millisecond
sample := pionMedia.Sample{Data: pkt.Data, Duration: bufferDurationCasted}
//sample = pionMedia.Sample{Data: pkt.Data, Duration: time.Second}
if err := audioTrack.WriteSample(sample); err != nil && err != io.ErrClosedPipe {
log.Log.Error("webrtc.main.WriteToTrack(): something went wrong while writing sample: " + err.Error())
}