Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Negative Indedxing When Using The "rsq" Corruption Config Parameter #48

Closed
Nfrederiksen opened this issue Jan 31, 2024 · 0 comments · Fixed by #49
Closed
Assignees
Labels
enhancement New feature or request

Comments

@Nfrederiksen
Copy link
Contributor

Nfrederiksen commented Jan 31, 2024

The Relative Sequence index config, rsq, is great for setting up an HLS corruption quickly. Skipping the step of having to look up what the stream's current media-sequence number is.

However, it would be even more effective if the users could configure to target the corruption onto a segment calculated from the bottom of the playlist manifest, instead of the top, as this can be a cumbersome task to calculate depending on the size of the playlist manifest.

Corrupting the segments at/near the bottom of the manifest is a good way to simulate errors from players who get too close to the live edge in a stream, trying to access a segment file that is yet to be downloadable.

This improvement would streamline the process of simulating real-world scenarios and enhance the product's capability to replicate edge-case conditions encountered by HLS players.

Proposed Solution

I propose a solution for rsq to also be able to accept negative integers in which it will step from the bottom of the segments list rather than the top.

ie.

The Corruption query ?url=https://mock.mock.com/stream/hls/master.m3u8&statusCode=[{rsq:-1,code:404}]&delay=[{rsq:-2,ms:2000}]
Results in the following playlist manifest on the first load:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:10045
#EXT-X-PLAYLIST-TYPE:LIVE
#EXTINF:10.0000,
https://mock.mock.com/stream/hls/manifest_1_010045.ts
#EXTINF:10.0000,
https://mock.mock.com/stream/hls/manifest_1_010046.ts
#EXTINF:10.0000,
https://mock.mock.com/stream/hls/manifest_1_010047.ts
#EXTINF:10.0000,
https://mock.mock.com/stream/hls/manifest_1_010048.ts
#EXTINF:10.0000,
https://mock.mock.com/stream/hls/manifest_1_010049.ts
#EXTINF:10.0000,
../../segments/proxy-segment?url=https%3A%2F%2Fmock.mock.com%2Fstream%2Fhls%2Fmanifest_1_010050.ts&delay=%7Bms%3A2000%7D
#EXTINF:10.0000,
../../segments/proxy-segment?url=https%3A%2F%2Fmock.mock.com%2Fstream%2Fhls%2Fmanifest_1_010051.ts&statusCode=%7Bcode%3A404%7D
@Nfrederiksen Nfrederiksen added the enhancement New feature or request label Jan 31, 2024
birme pushed a commit that referenced this issue Feb 1, 2024
* feat(#48): Added support for negative indexing when using rsq

* fix: removed console.log and fixed wrong example url in readme

* chore: added info about the use of negative rsq values to README

* fix: removed console.log left over from testing
@zapfire88 zapfire88 linked a pull request Feb 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants