MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / seek

Method seek

scenedetect/video_stream.py:193–212  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 ...

Callers 8

test_vfr_seek_pyavFunction · 0.45
test_seekMethod · 0.45
test_seek_startMethod · 0.45
test_read_eofMethod · 0.45
test_seek_past_eofMethod · 0.45
test_seek_invalidMethod · 0.45
detectFunction · 0.45

Calls

no outgoing calls

Tested by 7

test_vfr_seek_pyavFunction · 0.36
test_seekMethod · 0.36
test_seek_startMethod · 0.36
test_read_eofMethod · 0.36
test_seek_past_eofMethod · 0.36
test_seek_invalidMethod · 0.36