npm mediabunny 1.63.0
v1.63.0

3 hours ago

This release includes the work of Project Sync (#580), an effort to ensure that Mediabunny delivers sample-perfect audio-video sync across all codecs and containers.


  • Added automatic audio encoder priming delay compensation to ensure sample-accurate audio encoding and AV sync (#444, #447)
  • Made sure WebCodecs and extension package audio encoders/decoders always emit correct timestamps, even in the presence of dropped audio data (like with Opus's preskip)
  • Fixed WebKit's AAC encoder discarding the first 1024 samples
  • Added InputAudioTrack.getPreRollDuration() to signal how much preroll the audio decoder needs to properly converge. Media sinks automatically use this value under the hood to begin decoding audio earlier to give exact results when seeking.
  • Added HlsOutputFormatOptions.mediaTimestampBase (defaults to 10 seconds)
  • Added MpegTsOutputFormatOptions.timestampOffset
  • HLS reading: Now provides exact cross-variant track synchronization, and ID3v2 PRIV metadata in MP3 and ADTS is now respected for correct sync with "packed" segment formats
  • HLS reading: Removed approximate first packet start offset of mediaSequence * targetDuration
  • HLS reading: Now properly handles infinite-duration playlists (and live streams) that use internal media timestamps that wrap around
  • HLS writing: Now normalizes internal media timestamps and properly writes ID3v2 PRIV metadata to MP3 and ADTS
  • Matroska muxer: CodecDelay is now used to signal audio priming delay, SeekPreRoll is now correctly set for all audio codecs, and the duration of the last packet in a Cluster is now written
  • ISOBMFF muxer: Write roll sample description groups for audio codecs
  • Ogg muxer: Correctly supports start packets with negative timestamps signaling priming delay
  • MP3 muxer: Write "Info" instead of "Xing" for CBR streams
  • Matroska demuxer now respects CodecDelay
  • Various Ogg demuxer fixes
  • Various media sink fixes
  • MetadataTags.raw now supports Uint8Array[] for repeated non-text ID3v2 frames
  • Fixed PES packet data being kept alive in MPEG-TS demuxer's reference index (#599)
  • Fixed resampling floating point error edge cases (#586)
  • Improved (reduced) memory retained by BufferTarget (#585)
  • Fixed final FLAC frame being ignored if it was less than 16 bytes long (#593)
  • Fixed Matroska CuePoints being written even for tracks with no key packets in that Cluster (#597)
  • Added workaround for WebKit AVC encoder stall (#587)

Don't miss a new mediabunny release

NewReleases is sending notifications on new releases.