From c516f54a0710d7c0d4d8fd15d4266b9138f86d6a Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Fri, 1 Mar 2024 05:15:47 +0000 Subject: [PATCH] refactor(DASH): Change how Video FPS is gotten to remove FutureWarning log --- devine/core/manifests/dash.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/devine/core/manifests/dash.py b/devine/core/manifests/dash.py index aa8e386..d7f943b 100644 --- a/devine/core/manifests/dash.py +++ b/devine/core/manifests/dash.py @@ -114,6 +114,7 @@ class DASH: for rep in adaptation_set.findall("Representation"): get = partial(self._get, adaptation_set=adaptation_set, representation=rep) findall = partial(self._findall, adaptation_set=adaptation_set, representation=rep, both=True) + segment_base = rep.find("SegmentBase") codecs = get("codecs") content_type = get("contentType") @@ -141,6 +142,10 @@ class DASH: if content_type == "video": track_type = Video track_codec = Video.Codec.from_codecs(codecs) + track_fps = get("frameRate") + if not track_fps and segment_base is not None: + track_fps = segment_base.get("timescale") + track_args = dict( range_=self.get_video_range( codecs, @@ -150,7 +155,7 @@ class DASH: bitrate=get("bandwidth") or None, width=get("width") or 0, height=get("height") or 0, - fps=get("frameRate") or (rep.find("SegmentBase") or {}).get("timescale") or None + fps=track_fps or None ) elif content_type == "audio": track_type = Audio