diff --git a/av/stream.pyi b/av/stream.pyi index 18e6fdca9..8289a6358 100644 --- a/av/stream.pyi +++ b/av/stream.pyi @@ -1,6 +1,6 @@ from enum import Flag from fractions import Fraction -from typing import Any, Literal, cast +from typing import Literal, cast from .codec import Codec, CodecContext from .container import Container @@ -36,7 +36,7 @@ class Stream: profiles: list[str] profile: str | None index: int - options: dict[str, Any] + options: dict[str, object] time_base: Fraction | None average_rate: Fraction | None base_rate: Fraction | None @@ -48,6 +48,9 @@ class Stream: language: str | None type: Literal["video", "audio", "data", "subtitle", "attachment"] + # From context + codec_tag: str + class DataStream(Stream): type: Literal["data"] name: str | None diff --git a/tests/test_encode.py b/tests/test_encode.py index 23cbdc275..9284a9c82 100644 --- a/tests/test_encode.py +++ b/tests/test_encode.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import io import math from fractions import Fraction @@ -409,7 +411,9 @@ def test_max_b_frames(self) -> None: assert actual_max_b_frames <= max_b_frames -def encode_frames_with_qminmax(frames: list, shape: tuple, qminmax: tuple) -> int: +def encode_frames_with_qminmax( + frames: list[VideoFrame], shape: tuple[int, int, int], qminmax: tuple[int, int] +) -> int: """ Encode a video with the given quantiser limits, and return how many enocded bytes we made in total.