You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the examples/bandwidth-estimation-from-disk/main.go file, the currentTimestamp variable is intended to track the current video frame's timestamp to ensure correct playback when switching video quality levels. However, currentTimestamp is not being updated correctly and remains at its initial value.
Update currentTimestamp after each video frame is read and sent. Here is the code snippet:
// ...
for ; true; <-ticker.C {
targetBitrate := estimator.GetTargetBitrate()
switch {
// ...
default:
frame, frameHeader, err = ivf.ParseNextFrame() // modify this section
}
switch {
// If we have reached the end of the file, start again
case errors.Is(err, io.EOF):
ivf.ResetReader(setReaderFile(qualityLevels[currentQuality].fileName))
// No error, write the video frame
case err == nil:
currentTimestamp = frameHeader.Timestamp // Update currentTimestamp
if err = videoTrack.WriteSample(media.Sample{Data: frame, Duration: time.Second}); err != nil {
panic(err)
}
// Handle other unknown errors
default:
panic(err)
}
}
The text was updated successfully, but these errors were encountered:
cozzl
changed the title
examples/bandwidth-estimation-from-disk currentTimestamp Not Updated Correctly
examples/bandwidth-estimation-from-disk currentTimestamp not updated correctly
Sep 2, 2024
In the
examples/bandwidth-estimation-from-disk/main.go
file, thecurrentTimestamp
variable is intended to track the current video frame's timestamp to ensure correct playback when switching video quality levels. However,currentTimestamp
is not being updated correctly and remains at its initial value.Update currentTimestamp after each video frame is read and sent. Here is the code snippet:
The text was updated successfully, but these errors were encountered: