Skip to content

isinstance tuple issue under python 3.6 but not python 3.8 (cv2.VideoCapture)? #220

Closed
@flyingfalling

Description

@flyingfalling

I ran an identical script on my laptop (ubuntu 20.04 with python3.8) versus a server (ubuntu 18.04 with python3.6).

I noticed that in new scenedetect 0.5.5, changes were made to VideoManager relating to behaving like cv2.VideoCapture. So this may be related to that.

On the laptop the script runs with no issue. However, on the server (with identical inputs/outputs), it returns the following error (related to python3-opencv?). In the script, I have not accidentally named something cv2.VideoCapture (i.e. nuked the type name with a local variable), which was my first thought. Did type handling change between 3.6 and 3.8?

I will look into this more later, for now, I wanted to see if there was a known issue (google did not turn anything up).

Traceback (most recent call last):
File "impls/i_02_split_scenes_single.py", line 192, in
split_scenes_for_video( vid_path, out_path, contthresh, minlen_sec, maxlen_sec );
File "impls/i_02_split_scenes_single.py", line 137, in split_scenes_for_video
times, frames = scenes_in_threshold( myvideo_manager, myscene_manager, mybase_timecode, contdet, minlen_sec, maxlen_sec, threshcuts_list );
File "impls/i_02_split_scenes_single.py", line 54, in scenes_in_threshold
myscenes1 = detectit( vidman, sceneman, basetime, detector );
File "impls/i_02_split_scenes_single.py", line 46, in detectit
vidman.start();
File "/home/riveale/.local/lib/python3.6/site-packages/scenedetect/video_manager.py", line 606, in start
self.seek(self._start_time)
File "/home/riveale/.local/lib/python3.6/site-packages/scenedetect/video_manager.py", line 629, in seek
if isinstance(self._curr_cap, cv2.VideoCapture):
TypeError: isinstance() arg 2 must be a type or tuple of types

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions