# What changed in av

> 45 changes in av 19 from its official release notes, upgrade guides and advisories: 14 breaking, 2 security, 9 new APIs and options. Each one cited. Sources checked 2026-10-28. HTML: https://unstale.sh/pypi/av/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## av 19

### Breaking changes

- 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. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- The metadata_encoding argument and matching attribute are removed; metadata is always read and written as UTF-8 with surrogateescape. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- The metadata_errors argument and matching attribute are removed; metadata is always read and written as UTF-8 with surrogateescape. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- 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. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Removed because FFmpeg no longer defines this capability. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Removed because FFmpeg no longer defines this capability. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Removed because FFmpeg no longer defines this capability. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- The undocumented attribute is removed; use CodecContext.is_hwaccel to check whether hardware acceleration is in use. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Returns None when the size cannot be determined instead of passing through a negative AVERROR. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Closing an output container frees its context; using it afterwards raises Container is not open. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Raises rather than freeing a context another thread is still muxing or closing. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Python 3.11 is no longer supported; binary wheels are built for Python 3.12 and later. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Replaces the Frame.side_data type stub's TypedDict with a SideDataContainer type. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Reading a Stream after its container is closed now raises instead of reading freed memory. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)

### Security

- Deep-copies AVChannelLayout to fix a double free. (19.0.2) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.2)
- Indexes are now range checked. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)

### New APIs and options

- Adds block_align. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- New enum names the chroma location values. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- 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. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Exposes context global side data as a dict of bytes keyed by packet side data name. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Exposes context global side data as a dict of bytes keyed by Type; stream-wide HDR metadata arrives here after a frame is decoded. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Use this attribute to check whether hardware acceleration is in use. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Reports whether a format wants fixed size audio frames. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- 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. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Exposes the frame's chroma sample position relative to luma samples. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)

### Performance

- Shares one SwsContext per thread rather than allocating one per frame, reducing RSS growth when many frames are alive. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)

### Behavior and default changes

- Lists every codec FFmpeg knows of, including data and attachment codecs, matching ffmpeg -codecs. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)

### Fixes and other changes

- Passes thread_count to the audio encode resampler. (19.0.2) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.2)
- Passes output options through so the protocol uses them. (19.0.2) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.2)
- Side data no longer holds its frame in a reference cycle, addressing the resulting object lifetime issue. (19.0.1) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.1)
- Indexes are now range checked. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- The getter now returns its value instead of always returning None. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Frames returned when flushing a codec context directly now carry the stream's time_base instead of None. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- A rejected add_stream() or add_mux_stream() no longer breaks the container. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Keeps its Graph alive, preventing a segfault when the link outlives the graph. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Follows filters auto-inserted during graph configuration instead of using a stale cached pad. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Follows filters auto-inserted during graph configuration instead of using a stale cached pad. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Unknown side data types added by newer FFmpeg versions become UNKNOWN_<value> members rather than raising ValueError. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Now satisfies the Mapping protocol: iteration yields Type keys, mapping views work, and values can also be accessed by slice. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Passes flags to the created context, enabling requests such as CUDA's AV_CUDA_USE_PRIMARY_CONTEXT. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Holding index_entries keeps its container alive; entries are copies that remain readable after close and index reallocation. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Negative indexes are now handled like any sequence; mvs[-1] returns the last vector. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- No longer raises for side data types FFmpeg has added since PyAV last listed them. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- Applies to opening output containers, and network writes no longer block every other Python thread. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
- 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. (19.0.0) — [release notes](https://github.com/PyAV-Org/PyAV/releases/tag/v19.0.0)
