MrBrax / LiveStreamDVR

An automatic livestream recorder
MIT License
309 stars 24 forks source link

Allow changing streamlink's new `--hls-segment-queue-threshold` option in the web interface #486

Closed timschneeb closed 5 months ago

timschneeb commented 5 months ago

After updating to the Docker develop image a while ago, I noticed that recordings often end early.

It turns out that Streamlink is now automatically stopping a recording if the HLS playlist is missing segments for more than around 18 seconds by default.

This is a problem if a streamer has connectivity issues for a short while but not long enough to let Twitch create a new separate stream.

Streamlink added a new command line option (--hls-segment-queue-threshold) to configure this behaviour. It would be great if it could be controlled by the user in the web interface.

For testing, I hardcoded that cmd option into the server code and set it to a really high value. That fixed the issue for me without any further incomplete recordings for the past few weeks.

Log:

[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p60, 1080p60 (best)
[cli][info] Opening stream: 1080p60 (hls)
[cli][info] Writing output to
/usr/local/share/twitchautomator/data/storage/vods/..../..../....ts
[plugins.twitch][info] Will skip ad segments
[stream.hls][error] Failed to fetch segment 739: Unable to open URL: https://video-edge-ced704.fra05.abs.hls.ttvnw.net/v1/segment/........)
[stream.hls][warning] No new segments in playlist for more than 18.00s. Stopping...
[cli][info] Stream ended
[cli][info] Closing currently open stream...

Related issue: https://github.com/streamlink/streamlink/issues/5476