Skip to content

Conversation

@bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Oct 30, 2025

Closes #5450
Replaces #5493, #5601

This is a rebase of #5601 with some additional changes. The main goal is to replace --hls-duration with a new --stream-segmented-duration CLI arg + session option that affects all segmented streams.

In addition to that, DASHStreams now also have a duration argument that can be used for dash://URL duration=... inputs.

The last commit is a fix for the Twitch plugin. Since ad segments always get filtered out, ad segments need a duration of zero, or they affect the duration counter. I'm aware that other plugins also filter out segments and that there's the (not-so-well-designed) --hls-ignore-names option, but those affect the writer threads, so durations of those filtered-out segments always are counted. This can be fixed at some point later.


The related hls-start-offset can be done later. I don't care about this for now. I want to finally update the stream implementations, and this is a first step that needs to be done. One small change at a time.

- Add stream duration logic to `SegmentedStreamWorker`
  and remove it from `HLSStreamWorker`
- Deprecate `--hls-duration` in favor of `--stream-segmented-duration`
  and update the session options respectively
- Fix duration limit being cast to `int`
- Update log message when ending the stream early
- Add tests
- Add `duration` parameter to `DASHStream`, similar to `HLSStream`
- Update, fix and add tests
@bastimeyer bastimeyer force-pushed the stream/segmented/refactor-duration branch from 60456e9 to 7a94f0b Compare October 31, 2025 07:16
@bastimeyer bastimeyer merged commit 4274168 into streamlink:master Oct 31, 2025
25 checks passed
@bastimeyer bastimeyer deleted the stream/segmented/refactor-duration branch October 31, 2025 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turn --hls-duration into a generic segmented-stream CLI arg and add support for DASH durations

1 participant