Skip to content

ABCVideoProvider

Source code in video_timestamps/video_provider/abc_video_provider.pyi
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class ABCVideoProvider:
    def get_pts(self, filename: str, index: int | None, video_stream_index: int | None = None) -> tuple[list[int], Fraction, Fraction]:
        """
        Parameters:
            filename: A video path.
            index: Absolute index of the stream in the file. Its position among *all* streams
                (audio, video, subtitles, etc.), regardless of their type.

                This is equivalent to ffmpeg/ffprobe's global stream index (ex: the `0` in `-map 0:0`).
                The stream at this index must be a video stream.

                Mutually exclusive with `video_stream_index`. Exactly one of the two must be specified.
            video_stream_index: Index of the video stream, relative to the other video streams in the file.

                This is equivalent to ffmpeg's `v` stream specifier (ex: `v:0` is the first video stream,
                `v:1` is the second video stream, etc).

                Mutually exclusive with `index`. Exactly one of the two must be specified.

        Returns:
            A tuple containing these 3 informations:

                1. A list of each frame's pts. The last pts correspond to the pts of the last frame + it's duration.
                2. The time_base.
                3. The fps.
        """

get_pts(filename, index, video_stream_index=None)

Parameters:

Name Type Description Default
filename str

A video path.

required
index int | None

Absolute index of the stream in the file. Its position among all streams (audio, video, subtitles, etc.), regardless of their type.

This is equivalent to ffmpeg/ffprobe's global stream index (ex: the 0 in -map 0:0). The stream at this index must be a video stream.

Mutually exclusive with video_stream_index. Exactly one of the two must be specified.

required
video_stream_index int | None

Index of the video stream, relative to the other video streams in the file.

This is equivalent to ffmpeg's v stream specifier (ex: v:0 is the first video stream, v:1 is the second video stream, etc).

Mutually exclusive with index. Exactly one of the two must be specified.

None

Returns:

Type Description
tuple[list[int], Fraction, Fraction]

A tuple containing these 3 informations:

  1. A list of each frame's pts. The last pts correspond to the pts of the last frame + it's duration.
  2. The time_base.
  3. The fps.
Source code in video_timestamps/video_provider/abc_video_provider.pyi
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
def get_pts(self, filename: str, index: int | None, video_stream_index: int | None = None) -> tuple[list[int], Fraction, Fraction]:
    """
    Parameters:
        filename: A video path.
        index: Absolute index of the stream in the file. Its position among *all* streams
            (audio, video, subtitles, etc.), regardless of their type.

            This is equivalent to ffmpeg/ffprobe's global stream index (ex: the `0` in `-map 0:0`).
            The stream at this index must be a video stream.

            Mutually exclusive with `video_stream_index`. Exactly one of the two must be specified.
        video_stream_index: Index of the video stream, relative to the other video streams in the file.

            This is equivalent to ffmpeg's `v` stream specifier (ex: `v:0` is the first video stream,
            `v:1` is the second video stream, etc).

            Mutually exclusive with `index`. Exactly one of the two must be specified.

    Returns:
        A tuple containing these 3 informations:

            1. A list of each frame's pts. The last pts correspond to the pts of the last frame + it's duration.
            2. The time_base.
            3. The fps.
    """