pypi / av
av
What changed in av 19, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-28.
14 breaking2 security9 new APIs and options1 performance1 behavior and defaults18 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initav 1945 changes
Breaking changes 14
Rational attributes now return AV.Rational values rather than fractions.Fraction and are never None; unset values are falsy AVRational(0, 1). Setters still accept fractions.Fraction.
The metadata_encoding argument and matching attribute are removed; metadata is always read and written as UTF-8 with surrogateescape.
The metadata_errors argument and matching attribute are removed; metadata is always read and written as UTF-8 with surrogateescape.
The stream_options argument and matching attribute are removed. Pass options for every stream, set codec_context.options for one, or use Container.add_stream(..., options={}) when writing.
Removed because FFmpeg no longer defines this capability.
Removed because FFmpeg no longer defines this capability.
Removed because FFmpeg no longer defines this capability.
The undocumented attribute is removed; use CodecContext.is_hwaccel to check whether hardware acceleration is in use.
Returns None when the size cannot be determined instead of passing through a negative AVERROR.
Closing an output container frees its context; using it afterwards raises Container is not open.
Raises rather than freeing a context another thread is still muxing or closing.
Python 3.11 is no longer supported; binary wheels are built for Python 3.12 and later.
Replaces the Frame.side_data type stub's TypedDict with a SideDataContainer type.
Reading a Stream after its container is closed now raises instead of reading freed memory.
Security 2
Deep-copies AVChannelLayout to fix a double free.
Indexes are now range checked.
New APIs and options 9
Adds block_align.
New enum names the chroma location values.
Exposes additional AVCodecContext fields, including pkt_timebase, frame_num, active_thread_type, bits_per_raw_sample, compression_level, rc_buffer_size, min_bit_rate, max_bit_rate setter, audio padding fields, and two-pass stats.
Exposes context global side data as a dict of bytes keyed by packet side data name.
Exposes context global side data as a dict of bytes keyed by Type; stream-wide HDR metadata arrives here after a frame is decoded.
Use this attribute to check whether hardware acceleration is in use.
Reports whether a format wants fixed size audio frames.
Adds FFmpeg enum members: Properties.FIELDS and ENHANCEMENT; PixFmtLoss.EXCESS_RESOLUTION and EXCESS_DEPTH; Flags2.icc_profiles; format.Flags.experimental; Interpolation.STRICT and UNSTABLE; ColorTrc.V_LOG; ColorPrimaries.V_GAMUT; and new sidedata and packet side data names.
Exposes the frame's chroma sample position relative to luma samples.
Performance 1
Shares one SwsContext per thread rather than allocating one per frame, reducing RSS growth when many frames are alive.
Behavior and default changes 1
Lists every codec FFmpeg knows of, including data and attachment codecs, matching ffmpeg -codecs.
Fixes and other changes 18
Passes thread_count to the audio encode resampler.
Passes output options through so the protocol uses them.
Side data no longer holds its frame in a reference cycle, addressing the resulting object lifetime issue.
Indexes are now range checked.
The getter now returns its value instead of always returning None.
Frames returned when flushing a codec context directly now carry the stream's time_base instead of None.
A rejected add_stream() or add_mux_stream() no longer breaks the container.
Keeps its Graph alive, preventing a segfault when the link outlives the graph.
Follows filters auto-inserted during graph configuration instead of using a stale cached pad.
Follows filters auto-inserted during graph configuration instead of using a stale cached pad.
Unknown side data types added by newer FFmpeg versions become UNKNOWN_<value> members rather than raising ValueError.
Now satisfies the Mapping protocol: iteration yields Type keys, mapping views work, and values can also be accessed by slice.
Passes flags to the created context, enabling requests such as CUDA's AV_CUDA_USE_PRIMARY_CONTEXT.
Holding index_entries keeps its container alive; entries are copies that remain readable after close and index reallocation.
Negative indexes are now handled like any sequence; mvs[-1] returns the last vector.
No longer raises for side data types FFmpeg has added since PyAV last listed them.
Applies to opening output containers, and network writes no longer block every other Python thread.
Applies to muxing and closing output containers; each mux gets the full timeout and close shares one across trailer writing and flushing. Only unseekable outputs are covered.