Skip to content

Any -> object #1938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions av/stream.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion tests/test_encode.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import io
import math
from fractions import Fraction
Expand Down Expand Up @@ -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.
Expand Down
Loading