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

Method position

scenedetect/backends/pyav.py:196–204  ·  view source on GitHub ↗

Current position within stream as FrameTimecode. This can be interpreted as presentation time stamp, thus frame 1 corresponds to the presentation time 0. Returns 0 even if `frame_number` is 1.

(self)

Source from the content-addressed store, hash-verified

194
195 @property
196 def position(self) -> FrameTimecode:
197 """Current position within stream as FrameTimecode.
198
199 This can be interpreted as presentation time stamp, thus frame 1 corresponds
200 to the presentation time 0. Returns 0 even if `frame_number` is 1."""
201 if self._frame is None or self._frame.pts is None or self._frame.time_base is None:
202 return self.base_timecode
203 timecode = Timecode(pts=self._frame.pts, time_base=self._frame.time_base)
204 return FrameTimecode(timecode=timecode, fps=self.frame_rate)
205
206 @property
207 def position_ms(self) -> float:

Callers

nothing calls this directly

Calls 2

TimecodeClass · 0.90
FrameTimecodeClass · 0.90

Tested by

no test coverage detected