Skip to content

Commit 480c0b2

Browse files
committed
added BlurDetect.Blur subclass
1 parent 8fed008 commit 480c0b2

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/ffmpegio/analyze.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,12 @@ class BlurDetect(MetadataLogger):
560560
media_type = "video" # the stream media type
561561
meta_names = ("blur",) # metadata primary names
562562
filter_name = "blurdetect"
563-
Output = namedtuple("Blur", ["time", "blur"])
563+
564+
class Blur(NamedTuple):
565+
"""output log namedtuple subclass"""
566+
567+
time: List[float | int] #: timestamp in seconds, frames, or pts
568+
blur: List[float] #: blurness score
564569

565570
def __init__(self, **options):
566571
self.options = options
@@ -589,8 +594,9 @@ def log(self, t: float | int, name: str, key: Optional[str], value: str):
589594
self.frames.append((t, float(value)))
590595

591596
@property
592-
def output(self):
593-
return self.Output(*zip(*self.frames))
597+
def output(self)->BlurDetect.Blur:
598+
"""log output"""
599+
return self.Blur(*zip(*self.frames))
594600

595601

596602
# 'frame:26 pts:26026 pts_time:0.867533\n'

0 commit comments

Comments
 (0)