fix(tracks): treat a zero-denominator video frame rate as unknown

This commit is contained in:
imSp4rky
2026-11-29 06:24:01 -07:00
parent 82991dd823
commit 6b662d4fc0
2 changed files with 25 additions and 3 deletions
+4
View File
@@ -249,6 +249,7 @@ class Video(Track):
fps: A number, float, or string representing the frames/s of the video.
Strings may represent numbers, floats, or a fraction (num/den).
All strings will be cast to either a number or float.
A zero denominator gives no fps.
hdr10plus: The DV track also carries HDR10+ metadata. The HDR10+ probe sets it.
hdr10_base: The DV track has an HDR10 base layer, as DV profile 8.1 does.
stereo: The track is stereoscopic 3D (MV-HEVC), with a second view for the other eye.
@@ -293,6 +294,9 @@ class Video(Track):
try:
self.fps = (FPS.parse(str(fps)) or None) if fps else None
except ZeroDivisionError:
logging.getLogger("Video").debug(f"Ignored fps {fps!r}: zero denominator")
self.fps = None
except Exception as e:
raise ValueError( # noqa: B904
"Expected fps to be a number, float, or a string as numerator/denominator form, " + str(e)