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

change the HLS stream quality during playback #15158

Open
voronoff2803 opened this issue Oct 22, 2024 · 4 comments
Open

change the HLS stream quality during playback #15158

voronoff2803 opened this issue Oct 22, 2024 · 4 comments

Comments

@voronoff2803
Copy link

Expected behavior of the wanted feature

It's surprising to me that I can't change the HLS stream quality during playback. This is necessary to display the highest quality image possible at any connection speed. This is the purpose of HLS. I am aware of the --hls-bitrate=<no|min|max|> parameter, but it only has an effect before the video starts, and changing this parameter during playback does not yield any results. I want to implement automatic quality adjustment for HLS content in my application, but I can't achieve this. Or am I missing something? Please advise.

Alternative behavior of the wanted feature

No response

Log File

No response

Sample Files

No response

@llyyr
Copy link
Contributor

llyyr commented Oct 23, 2024

https://github.com/christoph-heinrich/mpv-quality-menu

If you mean a direct hls stream, you can use playlist-play-index current to reload it.

@voronoff2803
Copy link
Author

https://github.com/christoph-heinrich/mpv-quality-menu

If you mean a direct hls stream, you can use playlist-play-index current to reload it.

I'm looking for something to implement adaptive quality selection in hls

@na-na-hi
Copy link
Contributor

na-na-hi commented Oct 23, 2024

Streams of multiple qualities are loaded as multiple audio/video tracks. --hls-bitrate just selects the default track to select at startup.

I want to implement automatic quality adjustment for HLS content in my application, but I can't achieve this.

You can. Simply change aid and vid at runtime when you want to change quality. The quality of the tracks as provided by the stream is available as track-list/N/hls-bitrate property. The demuxer-cache-* properties can be used to detect if the network is too slow/fast for the current quality.

@voronoff2803
Copy link
Author

Streams of multiple qualities are loaded as multiple audio/video tracks. --hls-bitrate just selects the default track to select at startup.

I want to implement automatic quality adjustment for HLS content in my application, but I can't achieve this.

You can. Simply change aid and vid at runtime when you want to change quality. The quality of the tracks as provided by the stream is available as track-list/N/hls-bitrate property. The demuxer-cache-* properties can be used to detect if the network is too slow/fast for the current quality.

Is it possible to start pre-caching the next segment of a video in higher or lower quality based on the current network conditions? This would help avoid playback interruptions and allow for smoother transitions between qualities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants