v6.1.0
Added
-
Typed
context/graphfield bags and aconfigurehook onEncoder,Decoder,FilterAPI,FilterComplexAPI,MuxerandDemuxer.context(encoder/decoder/muxer) andgraph(filters) are typed bags of the writable fields on the underlying native object (e.g.context: { bitRate: '5M', gopSize: 60, colorPrimaries: AVCOL_PRI_BT2020 }); rate-control fields still accept'5M'-style strings.configure(ctx | graph | fmt)is a callback for what the bag cannot express — flags viasetFlags, methods, or setter-only forms such as a'hvc1'FourCC string for-tag:v hvc1. Both run right before the object is opened/finalized (avcodec_open2,avfilter_graph_config,avformat_write_header), the bag first; for the muxer after the source metadata/disposition are copied, so values set there take precedence. TheDemuxerexposes onlyconfigure(fmt), called afteravformat_open_input/avformat_find_stream_info.const encoder = await Encoder.create(FF_ENCODER_LIBX265, { decoder, context: { bitRate: '5M', gopSize: 60 }, // typed, declarative field bag configure: (ctx) => { ctx.codecTag = 'hvc1'; }, // imperative escape (-tag:v hvc1) });
-
HardwareContext.auto()accepts apreferoption to prioritise specific hardware type(s) over the platform default order, e.g.auto({ prefer: AV_HWDEVICE_TYPE_VAAPI })to pick VAAPI ahead of QSV on Intel. Preferred types are tested first (and kept only if available), then the usual platform fallback applies. -
Bitstream filter extradata is now reflected in the output parameters. Filters that adapt container framing (
aac_adtstoasc,extract_extradata,dump_extra,*_mp4toannexb) emit the resulting global headers as packet side data rather than onpar_out.BitStreamFilterAPI.outputCodecParametersnow folds that side data in, so a stream copy that relies on it (includingMuxer'sbsfoption) writes a header with the correct codec configuration.
Changed
- Synced FFmpeg with the latest master (~380 upstream commits) — numerous bug fixes, stability and performance improvements. Highlights relevant to node-av users:
- Security hardening — ~29 overflow / bounds fixes across decoders, demuxers and filters
- swscale PAL8 — palette video handled by the new ops scaler engine
- AMF — zero-copy host memory mapping, HDR/colour metadata propagation,
high_qualityencoder preset - NVENC — AV1 hierarchical B-frame reference mode
- D3D11VA — native P016 (10/16-bit YUV 4:2:0) hardware decoding on Windows
- ONNX Runtime DNN backend — GPU inference for ML-driven filters (super-resolution, denoise, …)
- Dolby Vision — RPU detection across all NALs (better DoVi interop)
- Fragmented-MP4 / DASH / HLS correctness fixes
- Faster decode/encode on x86 (H.264 AVX2 intra-prediction, me_cmp SSSE3), AArch64 NEON and RISC-V RVV
- Regenerated constants, encoders, and decoders from updated FFmpeg headers
Deprecated
- Raw codec/graph field options moved to the
context/graphbag.Encoder'sbitrate/minRate/maxRate/bufSize(→context: { bitRate, rcMinRate, rcMaxRate, rcBufferSize }, still accepting'5M'-style strings),gopSize,maxBFrames,threadCount,threadType;Decoder'sthreadCount/threadType; andFilterAPI/FilterComplexAPI'sthreads(→graph: { nbThreads }),scaleSwsOpts,audioResampleOpts. They still work — set them via the bag instead.
Fixed
- Rotation / HDR side data was lost when transcoding. The muxer copied a stream's
coded_side_data(display matrix / rotation, HDR mastering display & content light level) only on stream copy, not when re-encoding — so a portrait phone video would play sideways and HDR metadata would vanish after a transcode. The encoder output path now copies it too, matching the stream-copy behaviour. - Demuxer dropped packets under backpressure in multi-stream pipelines (#263). When a single demuxer fed two consumers draining at different rates (e.g. a slow video chain alongside a fast audio chain), the demux thread discarded packets for whichever stream's queue was momentarily full instead of waiting for it to drain. This lost video reference frames and corrupted decoding (
missing reference picture,mmco: unref short failure,co located POCs unavailable). The read loop now applies per-stream backpressure and is paced by the slowest consumer, so no packet is dropped. - worker_threads safety. Native class constructor references are now
thread_local, so node-av objects can be created and used across multiple worker threads without crashing. - Cross-compiled Windows installs selected the wrong toolchain (#260). A cross install (
npm install --os=win32 --cpu=x64) incorrectly picked the MinGW FFmpeg build; it now defaults to the standard MSVC build (pass--libc=mingwto override). See the new Cross-Platform Packaging section in the README. Scalerfailed on QSV hardware frames (Scaler: filter produced no frame). The Intel QSV scaler (vpp_qsv) buffers internally and does not emit a frame synchronously after a single input, so the scaler's process-one-receive-one path got nothing back. It now flushes the graph to drain the pending frame and rebuilds it for the next call. Zero-latency hardware scalers (scale_vaapi,scale_vt) are unaffected.
📋 All Changes since v6.0.0
- chore: bump version to 6.1.0 (a5f5d67) - @seydx
- Update Changelog (f84eec3) - @seydx
- Update deps (6360844) - @seydx
- chore: bump version to 6.1.0-beta.3 (b41a849) - @seydx
- Update Changelog (35c3f61) - @seydx
- Change preference order for hardware types in HardwareContext (4dbe3c6) - @seydx
- Add prefer option to HardwareContext.auto for prioritizing hardware types (4ac0e61) - @seydx
- Update FFmpeg (e6fba7b) - @seydx
- Update FFmpeg (dcd2363) - @seydx
- Update Changelog (9c3767a) - @seydx
- Update constants (4dc9e94) - @seydx
- Update FFmpeg (4785a60) - @seydx
- chore: bump version to 6.1.0-beta.2 (ef444b6) - @seydx
- update deps (1d3e0dd) - @seydx
- Update Changelog (cdd701d) - @seydx
- Update examples (cfe7813) - @seydx
- Improve Scaler class to handle frame processing edge cases and add graph eviction (447b889) - @seydx
- Update deps (71b1715) - @seydx
- Update typings and docs (3935eb0) - @seydx
- chore: bump version to 6.1.0-beta.1 (b4d903b) - @seydx
- Update release scripts (2fa426a) - @seydx
- Update Changelog (266c7de) - @seydx
- Update Examples (8d98e4d) - @seydx
- Add configuration callback for Demuxer options to customize format context (721e92c) - @seydx
- Add context configuration options for FilterAPI and enhance graph setup handling (0499d28) - @seydx
- Add context configuration options for Encoder and enhance codec context handling (f1cce59) - @seydx
- Add context configuration options for Decoder and enhance codec context handling (d2b2c5d) - @seydx
- Add context configuration options for Muxer and enhance coded side data handling (61133ef) - @seydx
- Init context options (8ea52c0) - @seydx
- chore: bump version to 6.0.1-beta.6 (570d8f1) - @seydx
- Update Changelog (a9ff3e3) - @seydx
- Update examples (398970e) - @seydx
- Update deps (3202621) - @seydx
- Fix demuxer to prevent packet drops under backpressure in multi-stream pipelines (#263) (c13fb91) - @seydx
- chore: bump version to 6.0.1-beta.5 (5bd2f85) - @seydx
- Improve error messaging for unsupported audio formats in Encoder (8098830) - @seydx
- chore: bump version to 6.0.1-beta.4 (7f873f8) - @seydx
- Improve pull-based reading logic for streams in IOStream (b5dbd97) - @seydx
- chore: bump version to 6.0.1-beta.3 (4854885) - @seydx
- Add Cross-Platform Packaging section to README and improve toolchain detection in utils (42cb1bc) - @seydx
- Update dependabot (5ecebfc) - @seydx
- chore: bump version to 6.0.1-beta.2 (8373d26) - @seydx
- Update deps (e71ad4b) - @seydx
- Add support for new extradata in filtered packets and update bsf tests (7d1acfa) - @seydx
- chore: bump version to 6.0.1-beta.1 (9064954) - @seydx
- Update deps (64a3c14) - @seydx
- Make class constructors thread_local for worker_threads safety (d66feba) - @seydx
- Add stale workflow (358674f) - @seydx
- Update copyright year and author email in LICENSE and package.json (2cf8741) - @seydx
- Fix type reference for sharp.Channels (2245476) - @seydx
- Add comments to Windows binary selection logic (73e4759) - @seydx
- Update deps (eca3717) - @seydx
- Update Readme (19326ae) - @seydx
- Update Socket Badge link in README.md (1846e17) - @seydx
- Add Socket Badge to README (a4954e5) - @seydx
📦 Packages
The following platform packages have been updated to v6.1.0:
@seydx/node-av-darwin-arm64@6.1.0@seydx/node-av-darwin-x64@6.1.0@seydx/node-av-linux-arm64@6.1.0@seydx/node-av-linux-x64@6.1.0@seydx/node-av-win32-arm64-mingw@6.1.0@seydx/node-av-win32-x64-mingw@6.1.0@seydx/node-av-win32-arm64-msvc@6.1.0@seydx/node-av-win32-x64-msvc@6.1.0