mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.54k stars 2.92k forks source link

change the HLS stream quality during playback #15158

Open voronoff2803 opened 3 weeks ago

voronoff2803 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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.