Skip to content

[backends] Fix PyAV 19+ compatibility - #576

Merged
Breakthrough merged 1 commit into
mainfrom
pyav19-compat
Oct 10, 2026
Merged

Breakthrough merged 1 commit into
mainfrom
pyav19-compat

Conversation

@Breakthrough

@Breakthrough Breakthrough commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

It seems like a few values now return av.Rational now, similar to https://ffmpeg.org/doxygen/4.0/group__lavu__math__rational.html - for compatibility we convert back to Fraction internally, but it represents the same thing effectively. From the changelog:

Rational attributes (time_base, average_rate, base_rate, guessed_rate, framerate, rate, sample_aspect_ratio, and display_aspect_ratio) now return av.AVRational rather than fractions.Fraction, and are never None: an unset value is the falsy AVRational(0, 1). Test them with if not stream.time_base: instead of is None. Setters still accept a fractions.Fraction

@Breakthrough Breakthrough added this to the 0.7.2 milestone Oct 5, 2026
@Breakthrough
Breakthrough merged commit a7dee92 into main Oct 10, 2026
28 checks passed
@Breakthrough
Breakthrough deleted the pyav19-compat branch October 10, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant