Adjust frag_duration setting in stream#59135
Merged
allenporter merged 1 commit intohome-assistant:devfrom Nov 6, 2021
Merged
Conversation
|
Hey there @hunterjm, @allenporter, mind taking a look at this pull request as it has been labeled with an integration ( |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Proposed change
As I was doing more testing with LL-HLS I noticed a playback artifact when using hls.js with one of my cameras. The playback loader is consistently skipping the last part in a segment. This can be addressed somewhat in the frontend via playback options, but I think the cause is when the media fragments are consistently slightly too long and the metadata reported is slightly shorter. Near the end of the segment, the loader sees that the duration of the media it has already equals the total duration indicated in the metadata, so the last part is skipped. However, when actually concatenating the media itself, there is now a hole where the missing fragment should belong, which can cause playback problems.
Previously the fragmenting strategy was to use a higher
frag_durationparameter when streams have audio to avoid having any parts which are too short, as having any of these seems to break the iOS native player. However, with the addition of a floor for part duration metadata in #58036, this may not be a problem as long as the average part duration is still ok. Assuming this is the case, risking a too short part duration is better than risking a too long part duration, as a too long part duration may cause more issues with the last part having an inaccurate duration.This value seems to work better for my cameras, but we may need to tweak things further or perhaps make this
frag_durationmultiplier a tunable parameter depending on what other users experience.Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: