From e3bbbd9b940487c00b6b3274d0ec08fae1ac5bde Mon Sep 17 00:00:00 2001 From: felix Date: Mon, 26 Aug 2019 19:24:51 +0800 Subject: [PATCH] refactor(shot_detector): update ffmpeg api --- gnes/preprocessor/video/ffmpeg.py | 4 ++-- gnes/preprocessor/video/shotdetect.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gnes/preprocessor/video/ffmpeg.py b/gnes/preprocessor/video/ffmpeg.py index d85b4af3..606002fe 100644 --- a/gnes/preprocessor/video/ffmpeg.py +++ b/gnes/preprocessor/video/ffmpeg.py @@ -48,7 +48,7 @@ def apply(self, doc: 'gnes_pb2.Document') -> None: # video could't be processed from ndarray! # only bytes can be passed into ffmpeg pipeline if doc.raw_bytes: - frames = video_util.capture_frames(video_data=doc.raw_bytes, scale=self.frame_size, fps=self.frame_rate) + frames = video_util.capture_frames(input_data=doc.raw_bytes, scale=self.frame_size, fps=self.frame_rate) # remove dupliated key frames by phash value if self.duplicate_rm: frames = self.duplicate_rm_hash(frames) @@ -135,7 +135,7 @@ def apply(self, doc: 'gnes_pb2.Document') -> None: if self.use_image_input: frames = split_video_frames(doc.raw_bytes, self.splitter) else: - frames = video_util.capture_frames(video_data=doc.raw_bytes, scale=self.frame_size, fps=self.frame_rate) + frames = video_util.capture_frames(input_data=doc.raw_bytes, scale=self.frame_size, fps=self.frame_rate) if self.max_frames_per_doc > 0: random_id = random.sample(range(len(frames)), k=min(self.max_frames_per_doc, len(frames))) diff --git a/gnes/preprocessor/video/shotdetect.py b/gnes/preprocessor/video/shotdetect.py index b7b497ea..65cb143d 100644 --- a/gnes/preprocessor/video/shotdetect.py +++ b/gnes/preprocessor/video/shotdetect.py @@ -71,7 +71,7 @@ def apply(self, doc: 'gnes_pb2.Document') -> None: if doc.raw_bytes: all_frames = video_util.capture_frames( - video_data=doc.raw_bytes, + input_data=doc.raw_bytes, scale=self.frame_size, fps=self.frame_rate) num_frames = len(all_frames)