Releases: seydx/node-av
v5.0.3
node-av Release v5.0.3
📦 Updated Packages
The following platform packages have been updated to v5.0.3:
@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]
📋 All Changes since v5.0.2
- Update author and repository details in platform-template.json (ffff4a7)
- update release workflow (742f585)
- chore: bump version to 5.0.3 (f1b05b3)
- Merge pull request #118 from seydx/dependabot/github_actions/actions/cache-5 (e5a387e)
- Add AV_BUFFERSRC_FLAG_KEEP_REF to frame processing in FilterAPI for hw_frames_ctx reuse (fcdc656)
- Add AVCodecProp to AVFLAG_NONE constant (f205d8f)
- update deps (8e4c376)
- Bump actions/cache from 4 to 5 (36a27c7)
- Merge pull request #116 from Vanilagy/corrected-copy-docs (9678ca4)
- Correct Frame.copy and Frame.copyProps docs (72806c3)
- Merge pull request #110 from seydx/dependabot/npm_and_yarn/prettier-3.7.1 (d18a6ea)
- Merge pull request #109 from seydx/dependabot/npm_and_yarn/updates-16.9.2 (4deee82)
- Update npm downloads badge to show total downloads (b02c5df)
- Bump prettier from 3.6.2 to 3.7.1 (c0d92ac)
- Bump updates from 16.9.1 to 16.9.2 (b2fabf1)
- Remove redundant free checks (40c919d)
v5.0.2
node-av Release v5.0.2
📦 Updated Packages
The following platform packages have been updated to v5.0.2:
@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]
📋 All Changes since v5.0.1
- chore: bump version to 5.0.2 (3217787)
- Fix DtsPredict (e451a8f)
- Refactor DTS prediction in Demuxer to use native implementation and fix use after free in demuxer thread (67ede61)
- Add DTS prediction utility based on FFmpeg's ist_dts_update (17170b2)
- Fix tests (90d7ca3)
- Refactor async worker classes to hold references to Napi objects to prevent garbage collection of JavaScript objects during asynchronous operations (7163464)
- Refactor packet processing in pipeline functions for improved resource management and memory leak prevention (47e129e)
- Fix cloning, update errors and improve scheduler (69c958f)
- Update deps (ecb1918)
v5.0.1
node-av Release v5.0.1
📦 Updated Packages
The following platform packages have been updated to v5.0.1:
@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]
📋 All Changes since v5.0.0
- Increase assertion timeout for zero sleep in utilities tests (e46a72a)
- Improve audio timestamp calculation by validating frame size (08c1886)
- chore: bump version to 5.0.1 (5d783cc)
- Add getFrameConstraints method to HardwareContext for hardware resolution limits (260aa76)
- Increase timeout value for FMP4Stream and RTPStream (369e5c7)
- Add video and audio configuration options to FMP4Stream (ea60eeb)
- Add video width and height options to RTPStream and implement filtering logic (28043b5)
- Remove 'nobuffer' flag from RTPStream options (9bb3d68)
- Merge pull request #104 from seydx/dependabot/github_actions/actions/checkout-6 (4d75a00)
- Bump actions/checkout from 5 to 6 (e3b905a)
- Update deps (589c20f)
- Update deps (21ff3c2)
v5.0.0
node-av Release v5.0.0
📦 Updated Packages
The following platform packages have been updated to v5.0.0:
@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]
Breaking Changes
Encoder/Decoder/FilterAPI/BitStreamFilterAPI - Send/Receive Pattern
The encode, decode, filter, and process methods now follow FFmpeg's send/receive pattern more closely. FFmpeg can produce multiple output frames/packets for a single input (e.g., B-frames in encoding, frame buffering in decoding).
Changes:
- Methods now return
voidinstead of a singleFrameorPacket - You must call
receive()/receiveSync()to retrieve output frames/packets - Supports proper multi-frame/packet output handling
Migration Example:
// Before
const frame = await decoder.decode(packet);
const packet = await encoder.encode(frame);
// After
await decoder.decode(packet);
const frame = await decoder.receive(); // May need to call multiple times
await encoder.encode(frame);
const packet = await encoder.receive(); // May return multiple packetsAdded
Core Features
-
Fifo - Generic FIFO buffer bindings (AVFifo) for arbitrary data types
-
FilterComplexAPI - Support for complex filtergraphs with multiple inputs/outputs
- Advanced multi-input/multi-output filter operations
- Direct mapping to FFmpeg's filtergraph functionality
- Use cases: overlay, picture-in-picture, side-by-side, multi-stream mixing
-
WhisperTranscriber - High-level API for automatic speech recognition
- Based on OpenAI's Whisper model with whisper.cpp integration
- GPU acceleration support (Metal/Vulkan/OpenCL)
- Voice Activity Detection (VAD) for better audio segmentation
- Automatic model downloading from HuggingFace
- Multiple model sizes: tiny, base, small, medium, large
- Type-safe transcription segments with precise timestamps
Code Examples
FilterComplexAPI - Picture-in-Picture Effect:
import { FilterComplexAPI } from 'node-av/api';
using complex = FilterComplexAPI.create(
'[1:v]scale=320:240[pip];[0:v][pip]overlay=x=W-w-10:y=H-h-10[out]',
{
inputs: [{ label: '0:v' }, { label: '1:v' }],
outputs: [{ label: 'out' }],
}
);
for await (using frame of complex.frames('out', {
'0:v': decoder1.frames(input1.packets(streamIndex1)),
'1:v': decoder2.frames(input2.packets(streamIndex2)),
})) {
for await (using packet of encoder.packets(frame)) {
await output.writePacket(packet, outputStreamIndex);
}
}WhisperTranscriber - Audio Transcription:
import { Demuxer, Decoder, WhisperTranscriber } from 'node-av/api';
using transcriber = await WhisperTranscriber.create({
model: 'base.en',
modelDir: './models',
language: 'en',
useGpu: true,
});
await using input = await Demuxer.open('podcast.mp3');
using decoder = await Decoder.create(input.audio());
for await (const segment of transcriber.transcribe(decoder.frames(input.packets()))) {
const timestamp = `[${(segment.start / 1000).toFixed(1)}s - ${(segment.end / 1000).toFixed(1)}s]`;
console.log(`${timestamp}: ${segment.text}`);
// [0.0s - 5.2s]: Welcome to the podcast...
// [5.2s - 10.8s]: Today we will discuss...
// ...
}Fixed
EOF Handling & Stability
Comprehensive improvements to end-of-file handling across the entire API stack, ensuring data integrity and preventing frame/packet loss during stream termination:
- Decoder - Proper EOF propagation through decode/receive pipeline with complete buffer flushing
- Encoder - Correct EOF handling in encode/receive pipeline guaranteeing all buffered packets output
- FilterAPI - Consistent EOF processing through filter chains preventing dropped frames during flush
- Demuxer - Reliable EOF detection and signaling for all stream types
- Muxer - Proper finalization and trailer writing on EOF
General Improvements
- Various bug fixes and stability improvements across the codebase
📋 All Changes since v4.0.0
- chore: bump version to 5.0.0 (99a4d1d)
- npmignore (1a643ab)
- Update Readme (55dcdcd)
- Update Changelog (8ca6517)
- Update Changelog (01895bf)
- Update submodules (6aef023)
- Update tests (a0d8761)
- Refactor getArchitecture function to remove Windows architecture detection (d3cd64c)
- Add skipInCI option to transcribe tests (aabe7e3)
- Escape hell (caf1c71)
- Enhance FFmpeg path normalization in FilterPreset to escape colons and ensure Windows compatibility (1491496)
- Normalize file paths in FilterPreset (43ce0ee)
- Update Changelog (1aa050b)
- Reduce queue size to 3 in WhisperTranscriber tests (e46bfaf)
- Remove normalization of model paths in WhisperTranscriber (d34f620)
- Fix parameter formatting in FilterPreset.whisper (47198e8)
- Reduce segment limit to 3 for testing in WhisperTranscriber (8261226)
- Normalize model paths for FFmpeg filter compatibility in WhisperTranscriber (4e1f55e)
- Refactor WhisperTranscriber tests (493bef6)
- Enhance WhisperDownloader: improve file handling and error management during downloads (16630a3)
- Cleanup WhisperTranscriber (29f30d9)
- Fix FilterAPI reinitialization (4ec6978)
- Add audio samples for speech processing tests (ab82141)
- Update deps (41b4636)
- gitignore (d08454e)
- Add examples for Whisper subtitle generation and speech transcription (872de49)
- Add tests for WhisperTranscriber functionality and configuration options (4acb0c5)
- Add audio sample for speech processing tests (2308d85)
- Add Whisper transcriber and downloader for audio transcription (ba07698)
- Add GetMetadata method to Frame class for accessing frame metadata (c5e515b)
- Update node-gyp win mingw bindings (97d20c1)
- Update submodules (7316ef1)
- Lint & format (5fae44e)
- Update eslint config (f9909c0)
- gitignore (644a1a8)
- Add AVCodecProp to AVFLAG_NONE (35b88cb)
- Improve field count accuracy by checking codec properties in Demuxer (7ccdf05)
- Add codecProperties getter to CodecParameters for codec feature flags (28045b9)
- Debug win mingw dlls (cc008d2)
- gitignore (521f3e7)
- Update deps (835f324)
- Update node-gyp win mingw bindings (b012eae)
- Debug win missing dlls (cca14d5)
- Update node-gyp win msvc bindings (4a99efc)
- Update submodules (94dd99d)
- Fix node-gyp linux bindings (e2dabd4)
- Update node-gyp bindings (f780fdf)
- Update cache versions for build environments (a822c30)
- Update node-gyp bindings (61d2a9b)
- Update submodules (212a819)
- Update cache versions for build environments (0318e09)
- Update tests (5165627)
- Update examples (72681ee)
- Add fromObject method to create Rational instances from IRational objects (d60a7eb)
- Add methods to create frames from video and audio buffers (7168e8f)
- Update examples (e18323d)
- Refactor audio frame buffer handling in Encoder (a88c595)
- Update Changelog (7d9b742)
- Add AVFifo (545e97f)
- Add AVFifoFlag to AVFLAG_NONE (0d5f8cb)
- Clear pict_type in Encoder to allow the encoder to determine frame types independently (0d14030)
- Cleanup (0827034)
- Add new FilterComplexAPI (35ade3a)
- Refactor media options types to unify Demuxer and Muxer configurations (f6388a5)
- Update examples (2e6d1d7)
- Update deps (e25c8a3)
- Update URLs in documentation and package metadata to point to the correct repository (6e9c2c0)
- Update package.json to include main and types fields in exports (5949ec6)
- Update eslint config (0de6cf6)
- Update example (1578ec3)
- Add logo image to test data (584649a)
- Update tests (b7aa080)
- Signal EOF after processing packets in Demuxer generator (ac191c6)
- Refactor FilterAPI methods to improve EOF handling and clarify packet processing (9728649)
- Refactor sendToQueue method to handle null packets for flushing the pipeline in BSF (9ce8d3e)
- Refactor Encoder methods to improve EOF handling and clarify packet processing (1fb9237)
- Refactor Decoder methods to improve EOF handling and clarify packet processing (d1d7c0f)
- Update Muxer writePacket methods to accept null/undefined as EOF signal (9b26e22)
- Refactor send method to handle null items for flushing the pipeline (d7f1d9c)
- Update pipeline function to accept null frames in source parameter (916ec76)
- Add EOF constant (900f1e4)
v4.0.0
node-av Release v4.0.0
📦 Updated Packages
The following platform packages have been updated to v4.0.0:
@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]
Major Focus: FFmpeg CLI Compatibility & Production Stability
This release brings the High-Level API closer to FFmpeg CLI behavior, making it more intuitive, stable, and robust for production use.
Breaking Changes
Class Renaming: The High-Level API classes have been renamed to better reflect their FFmpeg terminology:
MediaInput→DemuxerMediaOutput→Muxer
High-Level API Refactoring: All High-Level API classes (Demuxer, Muxer, Decoder, Encoder, FilterAPI, BitStreamFilterAPI) have been refactored with improved type definitions, option handling, and significantly enhanced stability. Many aspects have been brought closer to FFmpeg CLI behavior, including automatic parameter propagation, metadata preservation, robust error handling, and better defaults. This makes the API more intuitive and production-ready.
Native Bindings Enhancement: Many additional useful utility functions have been added to the native bindings for improved low-level control and functionality.
Migration: Update your imports and class references. Review your High-Level API usage - some option property names/types may have changed. The Low-Level API remains stable.
Changed
- FFmpeg Update: Updated to latest FFmpeg master version with newest features, performance improvements, and bug fixes
Fixed
- Numerous bug fixes and stability improvements across the entire codebase
📋 All Changes since v3.1.3
- chore: bump version to 4.0.0 (5158402)
- Update deps (599ff1c)
- Update Changelog (746612e)
- Enhance MP4BoxType definition and add movFlags option for FMP4Stream configuration (5e87424)
- Update Readme (d3e3f8e)
- Update deps (210049d)
- Update submodules (d47a2de)
- Update constants (9a1eb88)
- Remove unused sync and async write options from RTPStream pipeline configuration (1014f7e)
- Update submodules (d8c8d91)
- Refactor RTPStream pipeline configuration to use object structure for video and audio processing (bc2a77f)
- Refactor fMP4Stream to use RFC 6381 codec strings; enhance encoder options and pipeline configuration (05f861a)
- Refactor codec string functions to unify DASH and HLS handling; update tests for new implementation (b53c5db)
- Update Readme (ccb0415)
- Add RTP streaming example to high-level API (a316e82)
- Update examples (a4ab9ad)
- Update tests (137b252)
- Update jsDoc (aade15e)
- Add BSF support to scheduler (8643707)
- Implement EOF handling to generators in high level api (b1f8966)
- Rename MediaInput to Demuxer and MediaOutput to Muxer (fb87a5b)
- Refactor BitStreamFilterAPI (58f2d0f)
- Add avAddQ function for rational number addition and update bindings (5cbf46d)
- gitignore (cbba0db)
- Refactor MediaOutput: replace bufferedPackets with preMuxQueue for improved packet management and add flushPreMuxQueues methods (ccfadfc)
- Enhance SyncQueue send method: allow null packet to signal EOF and update documentation (859d7a2)
- Refactor output handling in pipeline tests: replace 'using' statements with explicit output closure (d89c36f)
- Add tests for shared input processing in named pipelines (78e9f8b)
- Enhance MediaOutput options: update async write and sync queue descriptions (bcff4ee)
- Refactor FFmpeg build process: replace config file copying with verification and listing for improved debugging (9485bdc)
- Update cache versions and enhance FFmpeg build process: include config files in cache and add error checks for required headers (c608ee7)
- Update cache version for Linux and enhance FFmpeg build process (7a3c953)
- Update submodules (68538c4)
- Update deps (10a0312)
- Update README and examples: rename RTSP custom IO example, add new hardware-accelerated streaming example (377b0ca)
- Update node-gyp bindings (25df0f2)
- Add ParseExtradata method to CodecParameters for codec parameter extraction from extradata (58ff785)
- Add sample format option to RTPStream and update mtu to use MAX_PACKET_SIZE; enhance audio/video pipeline configuration and processing (9f47557)
- Update FMP4Stream to enhance buffer size configuration and streamline pipeline setup; change default buffer size to 2 MB and simplify audio/video pipeline handling. (03eac91)
- Enhance pipeline functionality with new named pipeline overloads for shared input and multiple outputs; streamline processing stages and improve output handling for better performance. (a9aed4e)
- Refactor MediaOutput to implement async write processing with a dedicated write queue; enhance buffering logic and streamline packet handling for improved performance and error management. (56e38ee)
- Refactor MediaInput to use constants for buffer sizes and queue limits; enhance stream state parsing for video streams with missing dimensions (af1f51e)
- Update MediaInputOptions and MediaOutputOptions interfaces with new buffer size defaults and additional options for packet handling (1dcb99c)
- Use IO_BUFFER_SIZE constant for default buffer size in IOStream (8c394ee)
- Implement push-based processing in Decoder, FilterAPI and Encoder with AsyncQueue and Scheduler integration (3a16b07)
- Add constants (d42a107)
- Add Scheduler class for managing component pipelines (1e22737)
- Add AsyncQueue class for promise-based blocking queue implementation (14d368f)
- Update Readme (09af164)
- Update Changelog (2ef490b)
- Update submodules (51a2a7f)
- Update tests (8d57c24)
- Update examples (5a349c3)
- Update exports (26fa4a1)
- Update high level options and typings (f5aaa8f)
- Refactor high level MediaOutput (3ac9156)
- Refactor high level MediaInput (8f23450)
- Refactor high level FilterAPI (3a7a85b)
- Refactor high level Encoder (7dbebfe)
- Refactor high level Decoder (05b28ee)
- Add test files for AV1, MJPEG, VP8, and VP9 codecs and update hardware context to support them (45e1270)
- Update Readme (a51bd28)
- Add example for testing hardware codec support (f684041)
- Lint and format (0d7c165)
- Add conditional stream handling for encoder and decoder in pipeline functions (a5f633c)
- Enhance metadata handling in FormatContext with caching and null checks (3fa7125)
- Add metadata caching and disposition flag methods to Stream class (f432631)
- Add allocation call in Dictionary.fromObject method (e47debe)
- Add methods for handling coded side data in CodecParameters (dc8d069)
- Add error handling to probeBuffer and probeBufferSync methods (c098e80)
- Add null checks to prevent use-after-free crashes in async bindings (fb31f43)
- Add optional flags parameter to buffersrcAddFrame and buffersrcAddFrameSync methods (beb834b)
- Update constants generator (cda0b15)
- Update constants generator (4afdbb0)
- Add quality properties to Frame and CodecContext classes (b447782)
- Add quality accessor methods to Frame class (e957168)
- Use AV_BUFFERSRC_FLAG_PUSH for immediate frame processing in BuffersrcAddFrameAsync and BuffersrcAddFrameSync (2b99acb)
- Add globalQuality accessor methods to CodecContext (9ecdc8d)
- Update deps (c4601a9)
- format (7098754)
- Add IDimension interface (2fb1de3)
- Refactor RTPStream class for improved input handling and codec support (925113d)
- Add getInput method to FMP4Stream and improve codec handling (1926b14)
- Refactor WebRTCStream class to improve codec handling and error management (1995627)
- Add GetParser method to Stream class for accessing codec parser context (0570efd)
- Add GetRepeatPict method and improve parser context management in CodecParser (b49168a)
- Update constants generator (c2f0396)
- Update imports (e596ff9)
- Add integer limit constants and special time constants to TypeScript exports (0a42756)
- Refactor PTS initialization in AudioFrameBuffer to always start from 0 for encoder frames (37c47ad)
- Add null checks in async worker classes to prevent use-after-free crashes (bd65a36)
- Enhance parameter validation in BuffersrcParametersSet (e1e16ef)
- Use hasFlags in FilterPreset and update exports (277cda1)
- Remove unnecessary Doxygen reference from applyCropping method documentation (e5af6bd)
- Update low level api tests (3b399dd)
- Add NativeSyncQueue interface and related exports for packet synchronization and update native types (b8348c6)
- Add functions for rational number operations and timestamp rescaling (fa24b7f)
- Add ptsWrapBits property and event flag methods to Stream class (788c790)
- Add hasFlags method to OptionInfo class for flag checks (545d210)
- Add hasFlags method to OutputFormat class for flag checks (b0a2ea2)
- Add aresampleSwrOpts getter and setter to FilterGraph for audio resampling options (cedf030)
- Add hasFlags method to InputFormat class for flag checks (ac4fce5)
- Add frame flags, error flags, duration, and cropping methods to Frame class (037411a)
- Add hasFlags method to Filter class for checking specific filter flags (1fffcc0)
- Add hasCapabilities method to Codec class for capability checks (92163c4)
- Add maxInterleaveDelta property and flag checking methods to FormatContext (f48604e)
- Add alphaMode parameter and methods to retrieve color space and range from buffer sink (5480c47)
- Add bits per coded/raw sample, frame size, and video delay properties to CodecParameters (03bbc05)
- Add bits per coded/raw sample properties and flag checking methods in CodecContext (4371957)
- Add timebase property and flag checking methods to Packet class (4c9632a)
- Add new utilities for rescaling and rational arithmetic in Utilities class (de92c96)
- Remove event flag methods and add accessors for pts wrap bits in Stream class (3ca1588)
- Refactor Packet class: remove flag methods and add time base accessors (9727607)
- Add accessors for...
v3.1.3
node-av Release v3.1.3
📦 Updated Packages
The following platform packages have been updated to v3.1.3:
@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]
📋 All Changes since v3.1.2
v3.1.2
node-av Release v3.1.2
📦 Updated Packages
The following platform packages have been updated to v3.1.2:
@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]
Added
RTSP Backchannel/Talkback Support
New methods for bi-directional RTSP communication with IP cameras
FormatContext.getRTSPStreamInfo(): Retrieve detailed stream information including:- Transport type (TCP/UDP)
- Stream direction (sendonly/recvonly/sendrecv)
- Codec details (ID, MIME type, payload type)
- Audio properties (sample rate, channels)
- MIME type
- FMTP parameters
FormatContext.sendRTSPPacket(): Send RTP packets to RTSP streams with automatic transport handling. Supports both TCP (interleaved) and UDP modes, enabling audio transmission to camera backchannel streams for two-way communication.
Use cases: IP camera talkback/intercom functionality, security system audio announcements, remote audio injection, WebRTC integration with original SDP parameters
See examples/rtsp-stream-info.ts for detailed RTSP stream inspection including FMTP parameters
See examples/browser/webrtc for a complete implementation of RTSP talkback.
📋 All Changes since v3.1.1
- chore: bump version to 3.1.2 (4a4737c)
- Update deps (4f58f72)
- Enable submodule fetching in build workflow (1c6a8c5)
- Update Changelog (ae158a6)
- Update submodules (de2d953)
- Enhance RTSP stream info retrieval by adding support for SDP MIME types and FMTP parameters (3f48f4d)
- Cleanup (972f498)
- Update examples (cf7ce6e)
- Enhance package creation and installation process by compressing binaries, adding post-install script, and updating package metadata (02d347d)
- Update Changelog (83c9dac)
- Add disposed flag to WebRTCStream and make RTP packet sending asynchronous (0940998)
- Implement asynchronous and synchronous RTP packet sending for RTSP streams (ddd6f8c)
- Add missing network header inclusion for cross-platform compatibility (dce9c1d)
- Fix bindings (a958eba)
- Merge pull request #78 from seydx/dependabot/github_actions/actions/download-artifact-6 (39a591d)
- Merge pull request #79 from seydx/dependabot/github_actions/actions/upload-artifact-5 (93db0cb)
- Update Changelog (4102fb3)
- Update deps (dd1a8ad)
- Add talkback functionality and improve WebRTC stream handling (72af7ff)
- Update RTSP stream handling and add support for rtsp backchannel (884b186)
- Refactor createSdp method to accept FormatContext array (a744a52)
- Add examples for SDP and RTSP stream information to documentation (5dad571)
- Add examples for SDP generation and RTSP stream information retrieval (2c49860)
- Add audio_pcma.wav test data file (df2221a)
- Update ffmpeg (b6b4f20)
- Bump actions/upload-artifact from 4 to 5 (afddb20)
- Bump actions/download-artifact from 5 to 6 (0a3a8ba)
- Update Stream Processing section to include network support and custom I/O callbacks (bcb70b3)
v3.1.1
node-av Release v3.1.1
📦 Updated Packages
The following platform packages have been updated to v3.1.1:
@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]
Added
MediaInput: Custom I/O callbacks support viaIOInputCallbacks
import { MediaInput } from 'node-av/api';
import type { IOInputCallbacks } from 'node-av/api';
const callbacks: IOInputCallbacks = {
read: (size: number) => {
// Read data from custom source
return buffer; // or null for EOF
},
seek: (offset: bigint, whence: AVSeekWhence) => {
// Seek in custom source
return offset;
}
};
await using input = await MediaInput.open(callbacks, {
format: 'mp4',
bufferSize: 8192
});MediaInput: Buffer input support in synchronous modeMediaInput.openSync()now acceptsBufferinput- Previously restricted due to callback requirements
- Enabled by direct callback invocation improvements
Fixed
- Critical: Fixed deadlock when using
usingkeyword withIOOutputCallbacksMediaOutputwith custom I/O callbacks now properly closes synchronously- Direct callback invocation in same thread eliminates event loop dependency
// This now works without deadlock!
try {
using output = MediaOutput.openSync(callbacks, { format: 'mp4' });
// ... write packets
// Automatically closes without deadlock
} catch (e) {
console.error('Error caught correctly!', e); // ✅ Works now
}📋 All Changes since v3.1.0
- chore: bump version to 3.1.1 (ab1978d)
- Update deps (d699a50)
- Update Changelog (24b741b)
- Update tests (467ff56)
- Update MediaInput/MediaOutput overloads (a51bc32)
- Add tests for IOOutputCallbacks (bfe6d4b)
- Update typings (d603802)
- Enhance MediaInput to support custom I/O callbacks and improve input handling (6343ba7)
- Update typings (0851f61)
- Fix IOContext to support direct synchronous callback calls in the main thread without deadlock (b521193)
- Update seek method to use AVSeekWhence type for better type safety in IO callbacks (1acfc45)
- Remove default analyzeduration and probesize from FFmpeg input options in FMP4Stream and WebRTCStream (daeda5e)
- Add inputOptions to FMP4Stream and WebRTCStream for FFmpeg configuration (97b3c24)
v3.1.0
node-av Release v3.1.0
📦 Updated Packages
The following platform packages have been updated to v3.1.0:
@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]
Added
WebRTC High-Level API
WebRTCSession: Complete WebRTC streaming with SDP negotiation and ICE handling- Automatic codec detection and transcoding (H.264, H.265, VP8, VP9, AV1 video; Opus, PCMA, PCMU audio)
- Hardware acceleration support
- Werift integration for peer connection management
import { WebRTCSession } from 'node-av/api';
const session = await WebRTCSession.create('rtsp://camera.local/stream', {
hardware: 'auto'
});
// Handle signaling
session.onIceCandidate = (candidate) => ws.send({ type: 'candidate', candidate });
const answer = await session.setOffer(sdpOffer);
await session.start();WebRTCStream: Library-agnostic WebRTC streaming with RTP callbacks for custom WebRTC implementations
fMP4/MSE High-Level API
FMP4Stream: Fragmented MP4 streaming for Media Source Extensions- Browser codec negotiation (H.264, H.265, AV1 video; AAC, FLAC, Opus audio)
- Automatic transcoding based on browser support
- Hardware acceleration support
import { FMP4Stream, FMP4_CODECS } from 'node-av/api';
const stream = await FMP4Stream.create('input.mp4', {
supportedCodecs: 'avc1.640029,mp4a.40.2', // From browser
hardware: 'auto',
onChunk: (chunk) => ws.send(chunk)
});
const codecString = stream.getCodecString(); // For MSE addSourceBuffer()
await stream.start();FMP4_CODECS: Predefined codec strings (H.264, H.265, AV1, AAC, FLAC, Opus)
📋 All Changes since v3.0.6
- Re-export werift types and classes (9fd2569)
- chore: bump version to 3.1.0 (1dd0f12)
- Update deps (382b24b)
- Update Changelog (f125668)
- Update fMP4 streaming example (3f7ff59)
- Add FMP4/MSE streaming implementation with codec negotiation and transcoding (3dd2d1a)
- Reorganize WebRTC API (11dfc8f)
- Remove unused codec compatibility functions and related imports from utils.ts (583f291)
- Reorganize imports in RTSP custom IO example (76d995e)
- Refactor WebRTC example to use high level WebRTC API (ce25a74)
- Add support for setting codecTag as string (FourCC) in CodecContext and CodecParameters (85e4389)
- Add codecTag and codecTagString properties to CodecContext (5cbac41)
- Add AV1 codec support for WebRTC compatibility checks and configuration (7d62271)
- Add audio sample file for testing purposes (fb8e0db)
- Add high level WebRTC stream and session implementation (9654c22)
v3.0.6
node-av Release v3.0.6
📦 Updated Packages
The following platform packages have been updated to v3.0.6:
@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]@seydx/[email protected]
📋 All Changes since v3.0.5
- chore: bump version to 3.0.6 (2ac1e21)
- Update deps (3999bbf)
- Add WebRTC streaming example and server implementation (8b66df6)
- Enhance setOption method to provide default values for type and searchFlags parameters (4de4801)
- Refactor filter graph tests to use structured options for setting video and audio parameters (dd7676d)
- Remove debug logging for option setting in OptionMember class (caf50b7)
- Refactor MediaOutput and types to simplify option handling and extend type support (15fc53d)
- Enhance setOption method to support automatic type conversion for FFmpeg options (af2672d)
- Add GetSampleFmtFromName utility function and corresponding tests (3f57504)
- Update jellyfin submodule (21997a6)
- Merge pull request #70 from seydx/dependabot/npm_and_yarn/vite-7.1.11 (3aed211)
- Bump vite from 7.1.10 to 7.1.11 (50e9753)