Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3401 +/- ##
===================================================
- Coverage 32.15038% 32.13857% -0.01181%
===================================================
Files 147 147
Lines 40830 40845 +15
===================================================
Hits 13127 13127
- Misses 26928 26943 +15
Partials 775 775
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
* Reduce segmenter ffmpeg's analyzeduration to 2s. This avoids waiting for audio during RTMP pull at the risk of missing late tracks, especially video with a long GOP. * Send current segment immediately when the publisher is ready to receive data, rather than waiting for the next segment. This reduces time-to-first-frame at the risk of higher *perceived* latency if playback happens to start at the current segment (which we are effectively buffering, instead of staying on the leading edge by waiting for the next segment) * Rearrange retry sleeps in the segmenter: if ffmpeg needs to retry, it will immediately check for stream existence and exit if necessary. If the stream still exists, only then will it sleep for 5 seconds. This avoids a 5 second delay in signaling EOF. * Add some comments around how retries are still kinda broken anyway * Fix a couple of missing body closes in mediamtx HTTP request handling * Log ffmpeg output on rtmp pull errors
f97e843 to
0b80cd4
Compare
leszko
approved these changes
Feb 20, 2025
Contributor
|
Looks good from my end. Thanks for the fixes Josh! |
mjh1
approved these changes
Feb 20, 2025
emranemran
approved these changes
Feb 21, 2025
Collaborator
Author
|
Also added a 2.5s analyzeduration to the output side of ffmpeg. That should trim a couple seconds off the output delay - it's not much but something for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reduce segmenter ffmpeg's analyzeduration to 2s. This avoids waiting for audio during RTMP pull at the risk of missing late tracks, especially video with a long GOP.
Send current segment immediately when the publisher is ready to receive data, rather than waiting for the next segment. This reduces time-to-first-frame at the risk of higher perceived latency if playback happens to start at the current segment (which we are effectively buffering, instead of staying on the leading edge by waiting for the next segment)
Rearrange retry sleeps in the segmenter: if ffmpeg needs to retry, it will immediately check for stream existence and exit if necessary. If the stream still exists, only then will it sleep for 5 seconds. This avoids a 5 second delay in signaling EOF.
Add some comments around how retries are still kinda broken anyway
Fix a couple of missing body closes in mediamtx HTTP request handling
Log ffmpeg output on rtmp pull errors