Nevcairiel / LAVFilters

LAV Filters - Open-Source DirectShow Media Splitter and Decoders
GNU General Public License v2.0
7.34k stars 789 forks source link

HLS: Select program with higher bitrate if video resolution in the same #451

Closed kasper93 closed 2 years ago

ale5000-git commented 2 years ago

It is possible that there is same resolution and different formats, in this case it is also possible that a better format give more quality with lower bitrate.

I think that the only case worth comparing the bitrate is when both resolution and format match.

PS: ref #442

Nevcairiel commented 2 years ago

There is a reason the variant_bitrate is used, even if not particularly good of a measure, its still an approximation in absence of better information. Many variable-bitrate codecs, especially audio (eg. AAC) do not provide any other measure, and this is used to select the highest quality variant - for example in BBC Radio streams.

kasper93 commented 2 years ago

I think that the only case worth comparing the bitrate is when both resolution and format match.

It is not really feasible to do universally, you wound need to calculate weighted bitrate based on codec and parameters, it is not always obvious. And in practice it is very uncommon to have higher bitrate, lower quality variant.

There is a reason the variant_bitrate is used, even if not particularly good of a measure, its still an approximation in absence of better information. Many variable-bitrate codecs, especially audio (eg. AAC) do not provide any other measure, and this is used to select the highest quality variant - for example in BBC Radio streams.

Are you responding to my changes or his comment? Because I'm confused. variant_bitrate will be the same for all streams in given program, so stream selection will not do anything, or am I missing a case here?

Nevcairiel commented 2 years ago

Merged manually with a different change for the variant bitrate