Repository navigation
Added
- node-av-lgpl, an LGPL build of node-av (#99). Same API, linked against FFmpeg built without GPL components: no libx264, libx265 and chromaprint, no GPL-only filters, and no libfdk_aac, which has its own license (AAC goes through FFmpeg's own encoder). H.264 and H.265 are encoded only with a hardware encoder: there is no LGPL software encoder for them, and
FMP4Streamsays so when it has to transcode without one. Install it asnpm install node-av@npm:node-av-lgplto keep thenode-av/...imports. Its FFmpeg CLI is@seydx/node-av-ffmpeg-lgpl. - node-av-light, a smaller build of node-av (#69). It keeps all of FFmpeg's own components and every hardware backend, plus x264, x265, Opus and libfdk_aac, and leaves out the less common external libraries: Whisper, libplacebo, libvpx, SVT-AV1, JPEG XL, WebP, Vorbis, Theora, libass, zimg, SRT, Blu-ray, teletext and tracker music. Its FFmpeg CLI is
@seydx/node-av-ffmpeg-light.
Changed
- The platform and FFmpeg CLI packages declare the license of the FFmpeg they contain. They said MIT, which only covers node-av's own code. The native binding links FFmpeg statically, so the packages now say
GPL-3.0-or-later AND FDK-AAC(LGPL-3.0-or-laterfor node-av-lgpl). The README lists what each variant contains and points out that node-av and node-av-light include libfdk_aac under the Fraunhofer FDK AAC license. - The platform and FFmpeg CLI packages ship their license texts. Each one contains the GPL or LGPL text of its FFmpeg, the Fraunhofer FDK AAC license where libfdk_aac is linked, and a LICENSE.md that links the exact FFmpeg sources the binary was built from.
- The Windows (MSVC) FFmpeg compiles its CUDA filters with clang instead of nvcc. nvcc needs
--enable-nonfree, which made the Windows x64 binaries non-redistributable. The filters (scale_cuda,overlay_cuda,tonemap_cuda, ...) stay the same, and node-av-lgpl has them as well.
Fixed
- node-av can be imported in an Electron renderer. The demuxer created a
SharedArrayBufferwhen the module loaded, which a renderer without cross-origin isolation doesn't have, so the import failed. It is now created on the first EAGAIN retry inpacketsSync(). Closing a demuxer also no longer callsunref()on the browser timers of a renderer, which are plain numbers. - Logging no longer aborts the process after a worker thread that set the log callback has ended. The callback belongs to the thread that called
Log.setCallback(). When that worker ended withoutLog.resetCallback(), the next FFmpeg log line from any other thread still went to its function. Logging now falls back to FFmpeg's default output. A callback that replaces one set in another thread also releases the old one. RTPStream.stop()andFMP4Stream.stop()close the input when a codec fails to close. A decoder, filter or encoder that was still busy threw fromclose()and the teardown ended there, so the input, e.g. an RTSP connection, stayed open. The error still reaches the caller.AudioFifochecks the length of the buffers it is given.write(),read(),peek()and their sync variants copiednb_samplesper buffer without looking at its size, so a buffer that was too short was read or written past its end. They now throw aRangeError, and aTypeErrorfor a plane that is not aBuffer.sendRTSPPacket()rejects a packet over 65535 bytes on a TCP session. The interleaved header has 16 bits for the length, a larger packet was sent with a wrong one. It now returnsAVERROR(EINVAL).- An input with custom I/O no longer reads freed memory when its
IOContextis garbage collected first. This could happen to an input that was dropped withoutclose()while it was still reading. Its reads now end with an error. - Reading an input with
packets()no longer crashes at the end of the stream on musl (Alpine). The DTS prediction read the stream's parser on the main thread, while the input's reader thread reads ahead and frees that parser at the end of the stream and on a seek. On musl this crashed now and then with a segmentation fault, elsewhere it could read a stale value. The parser state is now taken with each packet on the thread that reads it, as the FFmpeg CLI does. Stream.parserreturns a copy of the parser state instead of the stream's parser. The returnedCodecParserpointed to a parser FFmpeg frees at the end of the stream and on a seek, so readingrepeatPictafterwards read freed memory, and withreadFrame()the main thread touched a parser the reader thread was using. It now carries the state as of the last packet read from the stream, stays valid after the input is closed, and isnullbefore the first packet. It cannot parse; a parser of your own comes fromnew CodecParser()andinit().
📋 All Changes since v7.0.3
- chore: bump version to 7.1.0 (d3c5296) - @seydx
- Update Changelog (3c01d15) - @seydx
- Update eslint config (253b574) - @seydx
- Update deps (280e51d) - @seydx
- chore: bump version to 7.1.0-beta.2 (9c6470f) - @seydx
- Update Changelog (1cddd10) - @seydx
- Report the signal or exit code of a test process that died, the spec reporter only says test failed (92e1edb) - @seydx
- Return a copy of the parser state from Stream.parser, the wrapper pointed to a parser the reader thread frees at the end of the stream and on a seek (bded0b8) - @seydx
- Update Changelog (a924c8f) - @seydx
- Read the parser state on the thread that reads the packet, the DTS prediction touched a parser the input's reader thread frees at the end of the stream (e8162c9) - @seydx
- Publish the npm packages in parallel, the platform packages first and then the packages that pin them (843a579) - @seydx
- Update deps (15c6c48) - @seydx
- chore: bump version to 7.1.0-beta.1 (895ab3e) - @seydx
- Update Changelog (2016849) - @seydx
- Update Readme (5587c3a) - @seydx
- Skip the RTPStream transcode test without libx264, it falls back to software on runners without a hardware encoder (8fa6dfd) - @seydx
- Run the full test suite for every variant and skip tests that need a component the build leaves out (41da6a2) - @seydx
- Save the native addon cache right after the build instead of after the tests (6217a6a) - @seydx
- Cache the native addon in CI and skip its build when its inputs and FFmpeg are unchanged (37f209d) - @seydx
- Run the full test suite for the light variant and skip the whisper tests without the filter (378ec4c) - @seydx
- Report a missing H.264 encoder in FMP4Stream instead of failing on null (b505ac1) - @seydx
- Update test workflow (40d0790) - @seydx
- Update Changelog (22e70f4) - @seydx
- Load the demuxer in Electron renderers without SharedArrayBuffer and browser timers (a094fb3) - @seydx
- Use the MSVC FFmpeg build with the variants and the clang-compiled CUDA filters (26d0780) - @seydx
- Document the gpl, lgpl and light variants and their licenses in the README (e555b72) - @seydx
- Ship the FFmpeg and FDK AAC license texts and the source revisions in the binary packages (6989b36) - @seydx
- Build, test and publish every variant in CI (c76eaf4) - @seydx
- Build node-av in gpl, lgpl and light variants with their own native and FFmpeg CLI packages (334e4ab) - @seydx
- chore: bump version to 7.0.4-beta.1 (e7c9d26) - @seydx
- Update deps (ff4768e) - @seydx
- Update Changelog (d84923d) - @seydx
- Reject an RTSP packet that does not fit the interleaved header (bd6005c) - @seydx
- Check the buffer lengths in AudioFifo write, read and peek (f8847a5) - @seydx
- Guard the log callback against a worker thread that ends and against concurrent swaps (d1304ae) - @seydx
- Close the input of RTPStream and FMP4Stream when a codec fails to close (69cfa72) - @seydx
- Keep the callback data of a collected IOContext while an input still reads through it (94985f5) - @seydx
📦 Packages
The following packages have been updated to v7.1.0:
@seydx/node-av-darwin-arm64@7.1.0@seydx/node-av-darwin-x64@7.1.0@seydx/node-av-linux-arm64@7.1.0@seydx/node-av-linux-arm64-musl@7.1.0@seydx/node-av-linux-x64@7.1.0@seydx/node-av-linux-x64-musl@7.1.0@seydx/node-av-win32-arm64-msvc@7.1.0@seydx/node-av-win32-x64-msvc@7.1.0@seydx/node-av-ffmpeg-darwin-arm64@7.1.0@seydx/node-av-ffmpeg-darwin-x64@7.1.0@seydx/node-av-ffmpeg-linux-arm64@7.1.0@seydx/node-av-ffmpeg-linux-arm64-musl@7.1.0@seydx/node-av-ffmpeg-linux-x64@7.1.0@seydx/node-av-ffmpeg-linux-x64-musl@7.1.0@seydx/node-av-ffmpeg-win32-arm64@7.1.0@seydx/node-av-ffmpeg-win32-x64@7.1.0@seydx/node-av-lgpl-darwin-arm64@7.1.0@seydx/node-av-lgpl-darwin-x64@7.1.0@seydx/node-av-lgpl-linux-arm64@7.1.0@seydx/node-av-lgpl-linux-arm64-musl@7.1.0@seydx/node-av-lgpl-linux-x64@7.1.0@seydx/node-av-lgpl-linux-x64-musl@7.1.0@seydx/node-av-lgpl-win32-arm64-msvc@7.1.0@seydx/node-av-lgpl-win32-x64-msvc@7.1.0@seydx/node-av-ffmpeg-lgpl-darwin-arm64@7.1.0@seydx/node-av-ffmpeg-lgpl-darwin-x64@7.1.0@seydx/node-av-ffmpeg-lgpl-linux-arm64@7.1.0@seydx/node-av-ffmpeg-lgpl-linux-arm64-musl@7.1.0@seydx/node-av-ffmpeg-lgpl-linux-x64@7.1.0@seydx/node-av-ffmpeg-lgpl-linux-x64-musl@7.1.0@seydx/node-av-ffmpeg-lgpl-win32-arm64@7.1.0@seydx/node-av-ffmpeg-lgpl-win32-x64@7.1.0@seydx/node-av-light-darwin-arm64@7.1.0@seydx/node-av-light-darwin-x64@7.1.0@seydx/node-av-light-linux-arm64@7.1.0@seydx/node-av-light-linux-arm64-musl@7.1.0@seydx/node-av-light-linux-x64@7.1.0@seydx/node-av-light-linux-x64-musl@7.1.0@seydx/node-av-light-win32-arm64-msvc@7.1.0@seydx/node-av-light-win32-x64-msvc@7.1.0@seydx/node-av-ffmpeg-light-darwin-arm64@7.1.0@seydx/node-av-ffmpeg-light-darwin-x64@7.1.0@seydx/node-av-ffmpeg-light-linux-arm64@7.1.0@seydx/node-av-ffmpeg-light-linux-arm64-musl@7.1.0@seydx/node-av-ffmpeg-light-linux-x64@7.1.0@seydx/node-av-ffmpeg-light-linux-x64-musl@7.1.0@seydx/node-av-ffmpeg-light-win32-arm64@7.1.0@seydx/node-av-ffmpeg-light-win32-x64@7.1.0@seydx/node-av-ffmpeg@7.1.0@seydx/node-av-ffmpeg-lgpl@7.1.0@seydx/node-av-ffmpeg-light@7.1.0node-av@7.1.0node-av-lgpl@7.1.0node-av-light@7.1.0