From b12f7bdb2bab50de87ed56cc0c69d426901856b4 Mon Sep 17 00:00:00 2001 From: Gennady Kozlenko Date: Fri, 20 Feb 2026 18:03:10 +0100 Subject: [PATCH] Version 2.5.0 Index Format Update The index file format has been updated to version 3 to support the `maxFragmentDuration()` method and precise HLS `#EXT-X-TARGETDURATION` calculation. Existing version 2 index files must be regenerated. HLS and Fragmenting - Soft threshold: Introduced a soft threshold (10% tolerance) when cutting video fragments to hit target chunk sizes more accurately and prevent overshoots. - Audio-only: Added support for audio-only streams (setting PCR timestamps, disabling segment merging for playback stability). - Precision & Offsets: Eliminated timestamp drift by using the source stream timescale and added support for negative sample offsets (`ctts` atom). Codec Parsing and Logic - Robust parsing: H.264 (AVCC) and H.265 (HVCC) parsing logic has been refactored: it is now stateless and includes strict buffer bounds and configuration version checks. - HEVC Open GOP fix: Added a fix for initial HEVC frames (patching CRA to BLA) to eliminate visual artifacts at chunk boundaries. Performance Optimizations - FragmentReader: Optimized I/O and reduced garbage collection (GC) pressure by introducing a coalesced read strategy and removing intermediate arrays. - HLS Packetizer: Removed unnecessary data copying and optimized the sample counter to work with different PIDs. - FragmentListBuilder: Improved performance by deriving duration directly from sample data and fixing truncation errors for the last fragment. --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c84921..50143ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-video-lib", - "version": "2.4.1", + "version": "2.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-video-lib", - "version": "2.4.1", + "version": "2.5.0", "license": "MIT", "devDependencies": { "@eslint/js": "^10.0.1", diff --git a/package.json b/package.json index dcd3be1..bb0a4ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-video-lib", - "version": "2.4.1", + "version": "2.5.0", "description": "Node.js Video Library / MP4 & FLV parser / MP4 builder / HLS muxer", "license": "MIT", "main": "index",