Skip to content

Accept Codec or codec name as BitStreamFilterContext in_stream #2337

Merged
WyattBlue merged 2 commits into
mainfrom
patch
Jul 1, 2026
Merged

Accept Codec or codec name as BitStreamFilterContext in_stream #2337
WyattBlue merged 2 commits into
mainfrom
patch

Conversation

@WyattBlue

Copy link
Copy Markdown
Member

No description provided.

WyattBlue added 2 commits July 1, 2026 15:42
sws_scale_frame (used since 17.0.0) validates color_trc/color_primaries and
rejects RESERVED and other unsupported values (e.g. LOG) with EOPNOTSUPP,
regressing plain reformat/to_ndarray to rgb24 on VP9 and NVDEC frames. The
pre-17.0 sws_scale ignored these fields.

Neutralize color_trc/color_primaries to UNSPECIFIED for the scale unless a
destination value is explicitly requested, while preserving the source's tags
on the returned frame. The YUV->RGB matrix and explicit conversions are
unaffected.
in_stream now takes a Stream, a Codec, a codec-name str, or None. A Stream
still copies the full input codec parameters, while a Codec or name only pins
par_in->codec_id/codec_type, which is enough for codec-specific filters to
initialize (filters that also need extradata still require a Stream).

Also corrects the AVBSFContext.par_in/par_out declarations to non-const to match
FFmpeg's header.
@WyattBlue WyattBlue merged commit debd890 into main Jul 1, 2026
8 checks passed
@WyattBlue WyattBlue deleted the patch branch July 1, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant