Make MPEG-DASH frame rate details configurable

- Fix #336
This commit is contained in:
MoojMidge 2024-02-07 12:46:30 +11:00
parent c376d5b50c
commit 13f1773660
6 changed files with 52 additions and 5 deletions

View file

@ -1384,3 +1384,11 @@ msgstr ""
msgctxt "#30770"
msgid "Are you sure you want to clear your Watch Later list?"
msgstr ""
msgctxt "#30771"
msgid "Enable framerate hinting"
msgstr ""
msgctxt "#30772"
msgid "Enable fractional framerate hinting"
msgstr ""

View file

@ -1384,3 +1384,11 @@ msgstr ""
msgctxt "#30770"
msgid "Are you sure you want to clear your Watch Later list?"
msgstr ""
msgctxt "#30771"
msgid "Enable framerate hinting"
msgstr ""
msgctxt "#30772"
msgid "Enable fractional framerate hinting"
msgstr ""

View file

@ -1380,3 +1380,11 @@ msgstr ""
msgctxt "#30770"
msgid "Are you sure you want to clear your Watch Later list?"
msgstr ""
msgctxt "#30771"
msgid "Enable framerate hinting"
msgstr ""
msgctxt "#30772"
msgid "Enable fractional framerate hinting"
msgstr ""

View file

@ -1385,3 +1385,11 @@ msgstr ""
msgctxt "#30770"
msgid "Are you sure you want to clear your Watch Later list?"
msgstr ""
msgctxt "#30771"
msgid "Enable framerate hinting"
msgstr ""
msgctxt "#30772"
msgid "Enable fractional framerate hinting"
msgstr ""

View file

@ -1344,13 +1344,25 @@ class VideoInfo(YouTubeRequestClient):
allow_hfr = 'hfr' in stream_features
disable_hfr_max = 'no_hfr_max' in stream_features
allow_ssa = 'ssa' in stream_features
fractional_frame_rate_hint = 'frac_hint' in stream_features
stream_select = _settings.stream_select()
fps_scale_map = {
0: '{0}000/1000', # --.00 fps
24: '24000/1001', # 23.97 fps
30: '30000/1001', # 29.97 fps
60: '60000/1001', # 59.97 fps
24: '24000/1001', # 23.976 fps
25: '25000/1000', # 25.00 fps
30: '30000/1001', # 29.976 fps
48: '48000/1000', # 48.00 fps
50: '50000/1000', # 50.00 fps
60: '60000/1001', # 59.976 fps
} if fractional_frame_rate_hint else {
0: '{0}000/1000', # --.00 fps
24: '24000/1000', # 24.00 fps
25: '25000/1000', # 25.00 fps
30: '30000/1000', # 30.00 fps
48: '48000/1000', # 48.00 fps
50: '50000/1000', # 50.00 fps
60: '60000/1000', # 60.00 fps
}
quality_factor_map = {
@ -1672,6 +1684,7 @@ class VideoInfo(YouTubeRequestClient):
_settings = self._context.get_settings()
stream_features = _settings.stream_features()
do_filter = 'filter' in stream_features
frame_rate_hint = 'fr_hint' in stream_features
stream_select = _settings.stream_select()
main_stream = {
@ -1823,7 +1836,7 @@ class VideoInfo(YouTubeRequestClient):
' bandwidth="{bitrate}"'
' width="{width}"'
' height="{height}"'
' frameRate="{frameRate}"'
' frameRate="{frameRate}"' if frame_rate_hint else ''
# quality and priority attributes are not used by ISA
' qualityRanking="{quality}"'
' selectionPriority="{priority}"'

View file

@ -263,7 +263,7 @@
</setting>
<setting id="kodion.mpd.stream.features" type="list[string]" parent="kodion.mpd.videos" label="30748" help="">
<level>0</level>
<default>avc1,vp9,av01,hdr,hfr,vorbis,mp4a,ssa,ac-3,ec-3,dts,filter</default> <!-- All features except opus and no HFR at max quality -->
<default>avc1,vp9,av01,hdr,hfr,fr_hint,frac_hint,vorbis,mp4a,ssa,ac-3,ec-3,dts,filter</default> <!-- All features except opus and no HFR at max quality -->
<constraints>
<options>
<option label="30727">avc1</option>
@ -272,6 +272,8 @@
<option label="30722">hdr</option>
<option label="30724">hfr</option>
<option label="30768">no_hfr_max</option>
<option label="30771">fr_hint</option>
<option label="30772">frac_hint</option>
<option label="30750">vorbis</option>
<option label="30751">opus</option>
<option label="30752">mp4a</option>