@@ -49,6 +49,8 @@ class SeekError(Exception):
49
49
50
50
The stream is guaranteed to be left in a valid state, but the position may be reset."""
51
51
52
+ ...
53
+
52
54
53
55
class VideoOpenFailure (Exception ):
54
56
"""Raised by a backend if opening a video fails."""
@@ -98,7 +100,7 @@ def base_timecode(self) -> FrameTimecode:
98
100
def BACKEND_NAME () -> str :
99
101
"""Unique name used to identify this backend. Should be a static property in derived
100
102
classes (`BACKEND_NAME = 'backend_identifier'`)."""
101
- raise NotImplementedError
103
+ ...
102
104
103
105
#
104
106
# Abstract Properties
@@ -108,43 +110,43 @@ def BACKEND_NAME() -> str:
108
110
@abstractmethod
109
111
def path (self ) -> Union [bytes , str ]:
110
112
"""Video or device path."""
111
- raise NotImplementedError
113
+ ...
112
114
113
115
@property
114
116
@abstractmethod
115
117
def name (self ) -> Union [bytes , str ]:
116
118
"""Name of the video, without extension, or device."""
117
- raise NotImplementedError
119
+ ...
118
120
119
121
@property
120
122
@abstractmethod
121
123
def is_seekable (self ) -> bool :
122
124
"""True if seek() is allowed, False otherwise."""
123
- raise NotImplementedError
125
+ ...
124
126
125
127
@property
126
128
@abstractmethod
127
129
def frame_rate (self ) -> float :
128
130
"""Frame rate in frames/sec."""
129
- raise NotImplementedError
131
+ ...
130
132
131
133
@property
132
134
@abstractmethod
133
135
def duration (self ) -> Optional [FrameTimecode ]:
134
136
"""Duration of the stream as a FrameTimecode, or None if non terminating."""
135
- raise NotImplementedError
137
+ ...
136
138
137
139
@property
138
140
@abstractmethod
139
141
def frame_size (self ) -> Tuple [int , int ]:
140
142
"""Size of each video frame in pixels as a tuple of (width, height)."""
141
- raise NotImplementedError
143
+ ...
142
144
143
145
@property
144
146
@abstractmethod
145
147
def aspect_ratio (self ) -> float :
146
148
"""Pixel aspect ratio as a float (1.0 represents square pixels)."""
147
- raise NotImplementedError
149
+ ...
148
150
149
151
@property
150
152
@abstractmethod
@@ -153,22 +155,22 @@ def position(self) -> FrameTimecode:
153
155
154
156
This can be interpreted as presentation time stamp, thus frame 1 corresponds
155
157
to the presentation time 0. Returns 0 even if `frame_number` is 1."""
156
- raise NotImplementedError
158
+ ...
157
159
158
160
@property
159
161
@abstractmethod
160
162
def position_ms (self ) -> float :
161
163
"""Current position within stream as a float of the presentation time in
162
164
milliseconds. The first frame has a PTS of 0."""
163
- raise NotImplementedError
165
+ ...
164
166
165
167
@property
166
168
@abstractmethod
167
169
def frame_number (self ) -> int :
168
170
"""Current position within stream as the frame number.
169
171
170
172
Will return 0 until the first frame is `read`."""
171
- raise NotImplementedError
173
+ ...
172
174
173
175
#
174
176
# Abstract Methods
@@ -186,12 +188,12 @@ def read(self, decode: bool = True, advance: bool = True) -> Union[np.ndarray, b
186
188
If decode = True, the decoded frame (np.ndarray), or False (bool) if end of video.
187
189
If decode = False, a bool indicating if advancing to the the next frame succeeded.
188
190
"""
189
- raise NotImplementedError
191
+ ...
190
192
191
193
@abstractmethod
192
194
def reset (self ) -> None :
193
195
"""Close and re-open the VideoStream (equivalent to seeking back to beginning)."""
194
- raise NotImplementedError
196
+ ...
195
197
196
198
@abstractmethod
197
199
def seek (self , target : Union [FrameTimecode , float , int ]) -> None :
@@ -213,4 +215,4 @@ def seek(self, target: Union[FrameTimecode, float, int]) -> None:
213
215
SeekError: An error occurs while seeking, or seeking is not supported.
214
216
ValueError: `target` is not a valid value (i.e. it is negative).
215
217
"""
216
- raise NotImplementedError
218
+ ...
0 commit comments