File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,15 +97,19 @@ def generator_from_webcam(
9797 if show_window :
9898 cv2 .destroyWindow (window_title )
9999
100- def load_uri_to_video_tensor (self : 'T' , only_keyframes : bool = False ) -> 'T' :
100+ def load_uri_to_video_tensor (
101+ self : 'T' , only_keyframes : bool = False , ** kwargs
102+ ) -> 'T' :
101103 """Convert a :attr:`.uri` to a video ndarray :attr:`.tensor`.
102104
103105 :param only_keyframes: only keep the keyframes in the video
106+ :param kwargs: supports all keyword arguments that are being supported by av.open() as
107+ described in: https://pyav.org/docs/stable/api/_globals.html?highlight=open#av.open
104108 :return: Document itself after processed
105109 """
106110 import av
107111
108- with av .open (self .uri ) as container :
112+ with av .open (self .uri , ** kwargs ) as container :
109113 if only_keyframes :
110114 stream = container .streams .video [0 ]
111115 stream .codec_context .skip_frame = 'NONKEY'
You can’t perform that action at this time.
0 commit comments