Seek to the given timecode. If given as a frame number, represents the current seek pointer (e.g. if seeking to 0, the next frame decoded will be the first frame of the video). For 1-based indices (first frame is frame #1), the target frame number needs to be converted to 0-
(self, target: TimecodeLike)
| 191 | |
| 192 | @abstractmethod |
| 193 | def seek(self, target: TimecodeLike) -> None: |
| 194 | """Seek to the given timecode. If given as a frame number, represents the current seek |
| 195 | pointer (e.g. if seeking to 0, the next frame decoded will be the first frame of the video). |
| 196 | |
| 197 | For 1-based indices (first frame is frame #1), the target frame number needs to be converted |
| 198 | to 0-based by subtracting one. For example, if we want to seek to the first frame, we call |
| 199 | seek(0) followed by read(). If we want to seek to the 5th frame, we call seek(4) followed |
| 200 | by read(), at which point frame_number will be 5. |
| 201 | |
| 202 | May not be supported on all backend types or inputs (e.g. cameras). |
| 203 | |
| 204 | Arguments: |
| 205 | target: Target position in video stream to seek to. |
| 206 | If float, interpreted as time in seconds. |
| 207 | If int, interpreted as frame number. |
| 208 | Raises: |
| 209 | SeekError: An error occurs while seeking, or seeking is not supported. |
| 210 | ValueError: `target` is not a valid value (i.e. it is negative). |
| 211 | """ |
| 212 | ... |
no outgoing calls