Repository navigation
Releases
v18.1.1
Fixes
-
Expose
Frame.best_effort_timestamp, FFmpeg's estimate of a frame's presentation time, which falls back to the DTS when the PTS is unreliable (#2477). -
Fix several crashes from reading freed or out-of-range memory:
- Reading a
Streamor itsindex_entriesafter the container is closed now raises instead of reading freed memory. AnIndexEntryis a copy, so it stays readable after the close. - Resuming
demux()ordecode()after the container is closed now raises instead of reading the freed format context. add_stream_from_template()checks that the template's container is still open.- Indexes are range checked before being turned into pointer arithmetic:
MotionVectors[i]accepts negative indexes, andVideoFormatComponent,AudioPlane,BitmapSubtitlePlane, andVideoBlockParamsreject out-of-range ones.VideoBlockParamsalso keeps itsVideoEncParamsalive. - A Python file whose
read(n)returns more thannbytes raisesValueErrorinstead of overflowing FFmpeg's I/O buffer. Packet(bytearray)copies the data, so resizing the bytearray afterwards no longer leaves the packet reading freed memory.- Inserting into a
Dictionarywhile iterating it no longer reads an invalidated entry. HWConfigand the side data wrappers can no longer be left holding a NULL pointer when created through__new__.
- Reading a
-
Fix crashes in filter graphs:
- A
FilterContextorFilterLinkthat outlives itsGraphkeeps the graph alive instead of using freed memory. push()to a buffer source configures the graph first, aspull()does.- Filters added or linked after
Graph.configure()are configured on the next push or pull instead of segfaulting. FilterContext.link_toraisesValueErrorwhen linking filters from different graphs instead of aborting the process.
- A
-
FilterLink.inputandFilterLink.outputnow follow the filters the graph auto-inserts while configuring, instead of the pad they first resolved. -
repr()of a filter pad no longer raisesAttributeError. -
Fix memory corruption when decoding audio with custom channel layouts (e.g.
"FR+FL"), which were shallow-copied and double freed (#2444). -
Fix a deadlock when freeing a frame-threaded decoder while a worker thread logs an error. The codec context is now freed with the GIL released (#2440).
-
Release the GIL around hardware frame transfers.
-
Fix corrupted rows in threaded high bit depth
VideoFrame.reformat()on x86 (#2431). -
VideoFrame.reformat()(and soto_ndarray(format=...),to_rgb(), andto_image()) shares oneSwsContextper thread instead of allocating one per frame, which used megabytes per frame with FFmpeg 8 (#2320). -
Fix reference cycles that kept frames, streams, and filters alive until gc ran: reading
Frame.side_data,MotionVectorsmemoizing its vectors,Stream.index_entries(#2425), and filter pads. -
Frame.side_datanow satisfies theMappingprotocol it advertises: iteration yieldsTypekeys, soitems(),keys(), andvalues()work instead of raisingKeyError. -
Frame.side_dataandPacketSideData.data_typeno longer raise on side data types FFmpeg has added since PyAV last listed them, such as theAV_PKT_DATA_HEVC_CONFan HEVC stream in MP4 or Matroska carries. -
Attaching one object to the
opaqueof more than one frame or packet no longer loses it when the first holder is freed. -
Frames returned by flushing a codec context directly (
CodecContext.decode()with no packet) now carry the stream'stime_baseinstead ofNone. -
A failed
CodecContext.open()no longer clears the selected codec, sois_encoderandis_decoderkeep working and the context can be reopened after fixing the offending parameters. -
A rejected
add_stream()oradd_mux_stream()no longer breaks the container, and a failed stream or output allocation no longer leaks. -
Output containers pass their options to
avio_open2(), so protocol options are used by the protocol. By @ANDYwyLEE. -
InputContainer.sizereturnsNonewhen the size cannot be determined instead of a negative error code. -
Audio encoding passes the codec's
thread_countto its internalAudioResampler, which no longer starts an idle thread per CPU for codecs without threading. By @tonyay163. -
AudioFrame.planesno longer counts one plane too many for 8-channel planar audio, and no longer reads pastextended_datafor more channels. By @ChandraChaan in (#2502). -
AudioFifo.write()raisesValueErrorfor a frame whose channel layout differs from the first frame's, instead of scrambling or over-reading the samples. By @ChandraChaan in (#2505). -
SubtitleCodecContext.decode(None)flushes the decoder instead of raisingRuntimeError, so delayed decoders such as EIA-608 closed captions return their final subtitle. -
AssSubtitle.dialoguestrips override tags such as{\b1}, turns\nand\hinto spaces, treats\{and\}as literal braces, and keeps a{with no closing}instead of dropping the rest of the line. -
HWAccel.createpassesflagson to the context it creates instead of dropping them. -
Packet(str)and settingCodecContext.extradatato astrno longer drop the last bytes of non-ASCII text. -
AVRationalvalues with a zero denominator compare and hash consistently withfloatandDecimalinfinities, and its operators returnNotImplementedfor unsupported operands. -
av.video.frame.supported_np_pix_fmtsnow listsyuv422p. -
BitStreamFilterContextnow passesin_stream's time base to the filter, so filters that read it, such assettswithTBandpcm_rechunk, no longer returnNonetimestamps. By @NotAFlightRisk. -
CodecContext.openreleases the GIL while the codec opens, as do creating a hardware device and its encoder frame pool, so other Python threads keep running while a hardware encoder takes seconds to start (#2517). -
Release the GIL while initializing filters, configuring filter graphs, listing devices, and creating the CUDA device and frame pool used by
VideoFrame.from_dlpack(), so slow setup such as loading awhispermodel or probing capture devices no longer stops other Python threads. -
FilterContext.push(None)on a filter that isn't a buffer source now flushes through its input instead of segfaulting. -
VideoFrame.from_numpy_buffer()raisesValueErrorwhenwidthis wider than the array's rows, instead of reading past the end of the buffer. -
VideoFrame.from_numpy_buffer()with agbrporgbrapformat no longer garbles input whose rows are padded, or reads past the end of its copy. -
Memory borrowed from read-only Python objects is no longer exported as writable: a
Packetmade frombytesorstr, a frame fromVideoFrame.from_numpy_buffer()on a read-only array, and side data now give read-onlymemoryviewobjects and refuseupdate(). -
Writing to a Python file object whose
write()accepts only part of each buffer, such as a socket or pipe, no longer silently drops the rest. -
Closing an input container opened with
io_opennow closes the fileio_openreturned for the main input, instead of leaving it open. -
Container.set_chapters()no longer leaks memory or drops the existing chapters when given an invalid entry. -
AVRational(x)now converts a float,DecimalorFractionexactly instead of truncating it to an integer, andAVRational(num, den)raisesTypeErrorunless both are integers. -
VideoFrame.reformat()no longer changes abt470bgframe's colorspace tosmpte170mwhendst_colorspaceisn't given. -
HWAccelnow raisesValueErrorfor an unknown device type name instead of falling back to the codec's first hardware config. -
frame.side_data.get()andinno longer raiseIndexErrorfor an out-of-range integer key. -
CodecContext.codec_tagno longer raisesUnicodeDecodeErrorfor a tag that isn't ASCII, such as AAC in WAV; it now reads and sets each byte as one Latin-1 character. -
A failed
VideoFrame.reformat()no longer leaves the source frame'scolor_trcandcolor_primarieschanged to unspecified. -
Setting
CodecContext.extradataorSubtitleCodecContext.subtitle_headernow zeroes the padding FFmpeg reads past the data, so an ASS header no longer reads past the end of its buffer. -
VideoFrame.from_numpy_buffer()withyuv420p,yuvj420p, ornv12now gets the right height when it isn't a multiple of 4. -
container.streams.best()raises an error on a closed container instead of segfaulting. -
OutputContainer.add_attachment()now pads its data with the zeroed bytes FFmpeg requires after it.
Full Changelog: v18.1.0...v18.1.1
v19.0.2
What's Changed
- Pass thread_count to the audio encode resampler by @tonyay163 in #2434
- Update hwcontext_cuda definitions by @jacob-amodo in #2439
- Pass output options so protocol uses them by @ANDYwyLEE in #2437
- Deep copy AVChannelLayout to fix double free, fixes #2444 by @WyattBlue in #2445
New Contributors
- @tonyay163 made their first contribution in #2434
- @jacob-amodo made their first contribution in #2439
- @ANDYwyLEE made their first contribution in #2437
Full Changelog: v19.0.1...v19.0.2
v19.0.1
What's Changed
- Fix #2425 by @WyattBlue in #2426
- Stop side data holding its frame in a reference cycle by @WyattBlue in #2427
- Build filter pads on access instead of caching them by @WyattBlue in #2428
Full Changelog: v19.0.0...v19.0.1
v19.0.0
Major
- Drop support for Python 3.11. Binary wheels are now built for Python 3.12 and later.
- Remove the undocumented
CodecContext.hwaccelattribute. It held theHWAccelsettings object passed in, not the live device context; useCodecContext.is_hwaccelto check whether hardware acceleration is in use. - Rational attributes (
time_base,average_rate,base_rate,guessed_rate,framerate,rate,sample_aspect_ratio, anddisplay_aspect_ratio) now returnav.AVRationalrather thanfractions.Fraction, and are neverNone: an unset value is the falsyAVRational(0, 1). Test them withif not stream.time_base:instead ofis None. Setters still accept afractions.Fraction. - Closing an
OutputContainernow frees its context, so using one afterwards raisesContainer is not openinstead of continuing against a finished file. Muxing has noavformat_close_input()to do this for it, soadd_stream(),mux(),start_encoding()and the rest kept working afterclose(), and streams held from it stayed readable. - Remove
Capabilities.hwaccel,Capabilities.hwaccel_vdpau, andCapabilities.neg_linesizes, none of which FFmpeg defines any more. - Remove the
metadata_encodingandmetadata_errorsarguments toav.open, and the matching attributes. Metadata is now always read and written as UTF-8 withsurrogateescape, which is byte exact: a tag in another encoding survives as surrogates and is recovered per key withvalue.encode("utf-8", "surrogateescape").decode("cp1251"). Previously one encoding had to be chosen for a whole container, so a file mixing encodings across tags could not be represented at all. - Remove the
stream_optionsargument toav.openand the matching attribute. They only ever reachedavformat_find_stream_info(), and only for formats that expose their streams before it runs, so they raised for MPEG and friends; output containers rejected them outright. Passoptionsfor every stream, setstream.codec_context.optionsfor one, andContainer.add_stream(..., options={})when writing.
Features
av.dump_codecs()now lists every codec FFmpeg knows of rather than only those with an encoder or a decoder, so data and attachment codecs appear, matchingffmpeg -codecs. Its legend gains the..D...and..T...media types.ContainerFormat.fixed_framesizereports whether a format wants fixed size audio frames.CodecContextexposes more ofAVCodecContext:pkt_timebase,frame_num,active_thread_type,bits_per_raw_sample,compression_level,rc_buffer_size,min_bit_rate, a setter formax_bit_rate, the audioinitial_padding,trailing_padding, andseek_preroll, andstats_in/stats_outfor two-pass encoding.VideoCodecContextgainschroma_sample_location,refs, andmb_decision;AudioCodecContextgainsblock_align.CodecContext.coded_side_dataandCodecContext.decoded_side_dataexpose the context's global side data as dicts ofbytes, keyed by packet side data name andTyperespectively. Stream wide HDR metadata, such as mastering display and content light level, arrives indecoded_side_dataonce a frame has been decoded.VideoFrame.chroma_locationexposesAVFrame.chroma_location, the position of the chroma samples relative to the luma samples, and the newChromaLocationenum names its values. Only the codec context side of the field was wrapped, asVideoCodecContext.chroma_sample_location, so the siting a decoder actually reported per frame could not be read at all. Each property mirrors its C field name, which FFmpeg spells differently on the two structs.- Enums gained the members FFmpeg has since added:
Properties.FIELDS,Properties.ENHANCEMENT,PixFmtLoss.EXCESS_RESOLUTION,PixFmtLoss.EXCESS_DEPTH,Flags2.icc_profiles,format.Flags.experimental,Interpolation.STRICT,Interpolation.UNSTABLE,ColorTrc.V_LOG,ColorPrimaries.V_GAMUT, theLCEVC,VIEW_ID,THREE_D_REFERENCE_DISPLAYS, andEXIFmembers ofsidedata.Type, and theexif,dynamic_hdr_smpte_2094_app5, andhevc_confpacket side data names.
Fixes
Frame.side_dataandPacketSideData.data_typeno longer raise on side data types FFmpeg has added since PyAV last listed them. The packet side data names were missing three, so reading, say, theAV_PKT_DATA_HEVC_CONFan HEVC stream in MP4 or Matroska carries raisedIndexError. A frame side data type that nosidedata.Typemember names, which is anything a newer FFmpeg than PyAV was built against added, now becomes anUNKNOWN_<value>member rather than raisingValueError.CodecContext.bit_rate_tolerancereturns its value instead of alwaysNone; the getter was missing itsreturn.- A rejected
add_stream()oradd_mux_stream()no longer breaks the container. InputContainer.sizereturnsNonewhen the size cannot be determined rather than the negativeAVERRORit was passing through, which read as a plausible byte count. A non-seekable input, such as a pipe, reported-78.av.dump_codecs()no longer drops the canonical namesh264,hevc,av1,dirac, andilbc, each of which was overwritten by the row of whichever encoder it resolved to.FilterLink.inputandFilterLink.outputnow follow the filters the graph auto-inserts while configuring. They cached the pad they first resolved, so reading one beforeGraph.configure()reported the filter the link no longer pointed at.- Fix a segfault when a
FilterLinkoutlives itsGraph. It held the graph by weak reference and dereferencedAVFilterLinkbefore consulting it, solink.inputandlink.outputread freed memory. It now holds the graph, as aFilterContextalready did. - Reading a
Streamor itsindex_entriesafter the container is closed now raises instead of reading freed memory, sinceavformat_close_input()frees the underlyingAVStream. Holding anindex_entriesalso keeps its container alive, and anIndexEntryis a copy, so it stays readable after the close and is unaffected by the demuxer reallocating the index. - Attaching one object to the
opaqueof more than one frame or packet no longer loses it. The objects were keyed byid(), so every holder shared an entry and whichever was freed first took it away from the rest. Frame.side_datanow satisfies theMappingprotocol it advertises: iteration yieldsTypekeys, soitems(),keys(), andvalues()work instead of raisingKeyError. Values remain reachable positionally by an integer or, for the first time, a slice. Its type stub was aTypedDictwith a single literal key, and is nowSideDataContainer.- Fix crashes from indexes that were turned into C pointer arithmetic without being range checked.
MotionVectors[i]only checked the upper bound, so a negative index read off the front of the buffer (mvs[-1]now returns the last vector, as with any sequence);VideoFormatComponentandAudioPlaneaccepted any index at all; andBitmapSubtitlePlaneandVideoBlockParamswere missing their lower bounds. - Frames returned by flushing a codec context directly (
CodecContext.decode()with no packet) now carry the stream'stime_baseinstead ofNone. VideoFrame.reformat()(and soto_ndarray(format=...),to_rgb(),to_image()) now shares oneSwsContextper thread instead of allocating one per frame. FFmpeg 8's swscale retains megabytes of graph state per context, which showed up as large RSS growth when many frames were alive at once.- Writing to a network URL no longer blocks every other Python thread, and
timeoutnow applies to opening an output container.avio_open(),avformat_write_header(),av_write_trailer(), andavio_closep()held the GIL, so an unreachable RTMP server froze the whole process, and the interrupt callback was only installed for demuxing, so nothing could end the wait.OutputContainer.closenow raises rather than freeing a context another thread is still muxing or closing. By @adrianrfreedman in (#2412). timeoutnow applies to muxing and closing an output container, not just to opening it. Only opening armed the interrupt callback, so a peer that accepted the connection and then stopped reading leftav_interleaved_write_frame()andav_write_trailer()blocked forever. Each mux gets the full timeout, and a close shares one across writing the trailer and flushing, so neither can outlast it. Only unseekable outputs are covered: writing a seekable file takes as long as the file is big, so a deadline meant for a peer would abandon it part-written. By @adrianrfreedman in (#2414).HWAccel.createnow passesflagson to the context it creates. They were dropped, soav_hwdevice_ctx_create()always got0and CUDA'sAV_CUDA_USE_PRIMARY_CONTEXTcould not be requested through them.
New Contributors
- @threexc made their first contribution in #2398
- @dylanpulver made their first contribution in #2405
- @happyme531 made their first contribution in #2404
- @adrianrfreedman made their first contribution in #2412
- @Robolightning made their first contribution in #2415
Full Changelog: v18.1.0...v19.0.0
v18.1.0
Features
- Infer the specific stream and codec context types for all FFmpeg encoder names in type-checked code by @WyattBlue.
- Add
CodecContext.supported_optionsto discover generic and codec-specific options by @WyattBlue (#2032). - Add
Packet.rescale_ts()to rescale packet PTS, DTS, and duration to a newAVRationaltime base by @WyattBlue. - Support reusing the thread's current CUDA context via a
current_ctxflag onCudaContextandVideoFrame.from_dlpack, for interop with libraries like PyTorch that initialize CUDA first by @Yozer (#2339). VideoFrame.from_dlpackno longer requires restatingprimary_ctx/current_ctxwhen passing an explicitcuda_context; the flags are only validated when explicitly given by @WyattBlue.- Support passing an explicit CUDA stream to FFmpeg CUDA operations, including NVENC input and output, via a
cuda_streamparameter onCudaContext; currently limited to logical CUDA device 0 by @Yozer (#2360). - Add
av.AVRational, an exact rational number stored as two int32s that mirrors FFmpeg'sAVRational.Codec.frame_ratesnow holds these rather thanfractions.Fraction, and every setter that accepts aFractionalso accepts anAVRational. Unset rational attributes are falsy, so test them withif not stream.time_base:rather thanis Noneby @WyattBlue. - Add
Frame.metadata, the metadata FFmpeg attaches to a frame, by @WyattBlue. - Add
CodecContext.levelby @WyattBlue. - Add
VideoCodecContext.field_orderby @WyattBlue. VideoFrame.savenow forwards keyword arguments to the encoder, letting callers trade file size for speed (e.g.pred="none"orcompression_level=1for PNG,qscale=2for JPG) by @WyattBlue.- Add
InputContainer.start_time_realtime, the stream's start time in microseconds since the Unix epoch, which RTSP derives from RTCP sender reports, by @WyattBlue (#2365).
Fixes
- Fix
VideoFrame.saveraisingAttributeErrorwhen given aPathrather than astrby @WyattBlue. - Fix a frame rate assigned to a
VideoStreamafteradd_streambeing dropped from the output; the codec context's frame rate is now copied to the stream before the header is written by @WyattBlue (#2301). - Prevent crashes and corrupted output when structural codec properties are changed after an output stream has been opened by @WyattBlue, reported by @oakaigh (#2232).
- Fix a crash when using a stream that has no
CodecContext(a demuxed stream with no available decoder, such as one from a truncated file, or a stream created byadd_mux_stream); decoding now raisesDecoderNotFoundError, encoding now raisesEncoderNotFoundError, andBitStreamFilterContextaccepts such a stream asout_streamby @WyattBlue, reported by @justinrmiller (#2344).
Misc
- Support building from source against FFmpeg 9.0 by @WyattBlue. The binary wheels still ship FFmpeg 8.1.2.
New Contributors
Full Changelog: v18.0.0...v18.1.0
v18.0.0
Major
- Remove Support for Python 3.10
- Upgrade binary wheels to ffmpeg 8.1.2
Features
- Support HW encoding via a
hwaccelparameter onOutputContainer.add_stream(e.g.h264_vaapi,h264_nvenc,h264_videotoolbox); software frames passed toencodeare uploaded to the device automatically by @WyattBlue (#2156). - Expose
sw_formatonVideoCodecContext, and allow configuring the software format of hardware encoders by @WyattBlue. - Add
optionsparameter toAudioResamplerfor passinglibswresampleoptions (e.g.resampler,filter_size,cutoff) by @WyattBlue (#2262). - Support
yuv420p10leinVideoFrame.to_ndarrayandVideoFrame.from_ndarrayby @WyattBlue (#1981). - Add
atparameter toGraph.pushandGraph.vpushto push a frame to a single buffer source by index, for multi-input filters likeoverlayby @WyattBlue. find_best_pix_fmt_of_listnow returns the loss as aPixFmtLossenum.IntFlaginstead of a plainintby @WyattBlue (#2300).- Add
Colorspace.BT2020by @mark-oshea. BitStreamFilterContextnow accepts aCodecor a codec-namestrasin_streamto pin the input codec without a fullStreamby @WyattBlue.
Fixes
- Fix
VideoFrame.reformat(andto_ndarray/to_rgb/to_image) raisingOSErrorOperation not supportedon frames tagged with reserved or otherwise unsupportedcolor_primaries/color_trcvalues (e.g. VP9 and NVDEC output); a transfer/primaries conversion is now only performed when explicitly requested by @WyattBlue (#2208). - Fix
add_mux_streamproducing unwritable Matroska files by extracting codec extradata from the bitstream before the header is written by @WyattBlue (#2198). - Encode GPU frames (e.g. CUDA frames from DLPack) directly with
pix_fmt="cuda"by adopting the frame'shw_frames_ctxbefore opening the encoder by @WyattBlue (#2199). - Fix a crash when reading
VideoCodecContext.pix_fmtbefore it is set; it now returnsNoneby @CarlosRDomin. - Preserve frame attributes (
pts,time_base, colorspace, etc.) when downloading hardware frames to system memory by @CarlosRDomin.
New Contributors
- @mark-oshea made their first contribution in #2325
Full Changelog: v17.1.0...v18.0.0
v17.1.0
Breaking
- Remove the undertested
av.optionandav.descriptorAPIs, along with the relatedCodecandFilterdescriptor accessors.
Features
- Use FFmpeg 8.1.1 in the binary wheels by @WyattBlue.
- Build Linux ARMv7 binary wheels by @WyattBlue.
- Expose
AVCodecContext.global_qualityby @WyattBlue in #2246. - Expose
Stream.discardso demuxing and seeking can skip unwanted streams by @WyattBlue (#2272). - Add
Stream.set_display_matrix()andStream.set_display_rotation()to write the container display (rotation) matrix on output streams by @hmaarrfk in #2287. - Add
Container.video_codec_idto force a specific video codec on a container by @WyattBlue (#2243).
Fixes
- Add
cython.finalto leaf classes, ensuring that they are not subclassed by @WyattBlue. - Warn that
CodecContext.decode()is not memory safe in some cases. - Fix memory leaks in
FFmpegError,AudioLayoutchannel layouts, andFrame.opaque, and break a reference cycle betweenFilterLinkandGraphby @lgeiger. - Reduce excessive logging lock contention by @WyattBlue (#2276).
- Fix a crash when accessing
Streamfrom multiple threads under FFmpeg 8.1 by @WyattBlue (#2247). - Fix a crash during
InputContainerinitialization by @WyattBlue (#2010). - Fix
enumerate_input_devicesandenumerate_output_devicesraisingAttributeErrorby @WyattBlue and @kazuki (#2264). - Map HTTP 429 to
HTTPTooManyRequestsErrorinstead ofUndefinedErrorby @WyattBlue (#2267). - Fix crash in
VideoFrame.to_ndarray()andto_image()on bottom-up frames with a negativeline_sizeby @WyattBlue (#2213). - Make
DispositionanIntFlagsoStream.dispositioncan be assigned without raisingTypeErrorby @HotariTobu. - Assign parser-inferred
pts,dts, anddurationto packets fromCodecContext.parse()by @WyattBlue (#1919). - Copy
time_baseinadd_stream_from_template()by @daveisfera in #2249. - Fix the remux examples dropping keyframes that demux with no DTS, which produced audio-only output by @WyattBlue (#1917).
- Fix subtitle UTF-8 handling by @jbree in #2271.
- Fix several incorrect
mallocsize calculations by @WyattBlue.
New Contributors
- @HotariTobu made their first contribution in #2257
- @jbree made their first contribution in #2271
- @kazuki made their first contribution in #2288
Full Changelog: v17.0.1...v17.1.0
v17.0.1
What's Changed
- Adjust tests so they work with ffmpeg 8.1 by @strophy in #2204 and #2205
- Make VideoFormat.components lazy by @WyattBlue in #2209
- Break reference cycle in
StreamContainer.get()by @lgeiger in #2221 - Expose
threadsin filter graph by @lgeiger in #2211 - Fix crash with container closing with GC by @WyattBlue in #2225
- Fix #2223 "Writing packets to data stream broken in av>=17" regression by @WyattBlue
- Remove
_send_packet_and_recvto simplifydecode()by @lgeiger in #2233 - Reuse a
AVPacketread buffer when demuxing by @lgeiger in #2234 - Use
AVCodecContext.frame_numinstead of counting ourselves by @WyattBlue in #2236 - Use
layout_compare()forAudioLayout.__eq__()by @WyattBlue in #2236
New Contributors
Full Changelog: v17.0.0...v17.0.1
v17.0.0
Major
- Limited API binary wheels are now built.
- 3.13t (free-threading) wheels are be dropped because of storage limitations. Use 3.14t or 3.13.
- When an FFmpeg C function indicates an error, raise av.ArgumentError instead of ValueError/av.ValueError. This helps disambiguate why an exception is being thrown.
- Save space by removing libaom (av1 encoder/decoder); dav1d, stvav1, and hardware, are available alternatives.
Features
- Add
OutputContainer.add_mux_stream()for creating codec-context-free streams, enabling muxing of pre-encoded packets without an encoder, addressing #1970 by @WyattBlue. - Use zero-copy for Packet init from buffer data by @WyattBlue in (#2199).
- Expose AVIndexEntry by @Queuecumber in (#2136).
- Preserving hardware memory during cuvid decoding, exporting/importing via dlpack by @WyattBlue in (#2155).
- Add enumerate_input_devices and enumerate_output_devices API by @WyattBlue in (#2174).
- Add
ColorTrcandColorPrimariesenums; addcolor_trcandcolor_primariesproperties toVideoFrame; adddst_color_trcanddst_color_primariesparameters toVideoFrame.reformat(), addressing #1968 by @WyattBlue in (#2175). - Add multithreaded reformatting and reduce Python overhead by replacing
sws_scalewithsws_scale_frame, skipping unnecessary reformats, and minimizing Python interactions by @lgeiger. - Prevent data copy in
VideoFrame.to_ndarray()for padded frames by @lgeiger in (#2190).
Fixes
- Fix #2149 by @WyattBlue in (#2155).
- Fix packet typing based on stream and specify InputContainer.demux based on incoming stream by @ntjohnson1 in (#2134).
- Fix memory growth when remuxing with
add_stream_from_templateby skippingavcodec_open2for template-initialized codec contexts, addressing #2135 by @WyattBlue). - Explicitly disable OpenSSL in source builds (
scripts/build-deps) to prevent accidental OpenSSL linkage that breaks FIPS-enabled systems, addressing #1972. - Add missing
SWS_SPLINEinterpolation by @lgeiger in (#2188).
New Contributors
- @wojiushixiaobai made their first contribution in #2076
- @ntjohnson1 made their first contribution in #2134
- @clayy24 made their first contribution in #2181
Full Changelog: v16.1.0...v17.0.0
v16.1.0
Features:
- Add support for Intel QSV codecs by @ladaapp.
- Add AMD AMF hardware decoding by @ladaapp2.
- Add subtitle encoding support by @skeskinen in #2050.
- Add read/write access to PacketSideData by @skeskinen in #2051.
- Add yuv422p support for video frame to_ndarray and from_ndarray by @wader in #2054.
- Add binding for
avcodec_find_best_pix_fmt_of_list()by @ndeybach in #2058.
Fixes:
- Fix #2036, #2053, #2057 by @WyattBlue.
New Contributors
- @ndeybach made their first contribution in #2052
- @benedikt-grl made their first contribution in #2070
Full Changelog: v16.0.1...v16.1.0