@svta/cml-iso-bmff changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
2.1.0 - 2026-11-30
Added
- The
truncatedoption ofIsoBoxReadConfigsets what a function that reads a list of boxes does before a truncated box. The default'stop'keeps the behavior of 2.0.0. With'throw',readIsoBoxes,readChildBoxes,nextIsoBox,iterateChildBoxes,seekIsoBoxandseekIsoBoxesthrow aRangeError(#782).
2.0.0 - 2026-11-29
Added
- The guide Migrating to version 2 lists each change of version 2.0.0 and its replacement (#682).
createIsoBoxReadCursorcreates a read cursor for ISO BMFF data. The cursor is a plain object with aDataView, a start, a position, and an end. The function takes the configuration ofreadIsoBoxes, with the readers map and theint64option (#682).- The read field functions read one field at the position of a read cursor and move the position past the field. The functions are
readUint8,readUint16,readUint24,readUint32,readUint64,readInt8,readInt16,readInt32,readTemplate16,readTemplate32,readFourCc,readBytes,readUtf8, andreadTerminatedUtf8(#682). - A read field function throws a
RangeErrorfor a field that passes the end of the cursor.readBytesandreadUtf8also throw aRangeErrorfor a negative length and for a length that is not an integer. A length of 0 reads nothing (#682). readWideUintandreadWideIntread an integer field of 4 or 8 bytes with theint64function of the read cursor. With no function, they return anumber. A custom reader that follows theint64option calls the two functions (#682).readChildBoxesreads the boxes from the position of a read cursor to its end, with the readers of the cursor. The optionalcountsets the maximum number of boxes. A negativecountorNaNthrows aRangeError. After an error of a reader, the position of the cursor is the first byte of the box that failed (#682).seekIsoBoxfinds a box by its path, such as['moof', 'traf', 'tfdt'], and returns a read cursor for that box. The function decodes no other box. The result isnullfor a missing box and for a truncated box (#682).nextIsoBoxreturns the type of the box at the position of a read cursor and moves the position past that box. The function parses no content of the box (#682).readIsoBoxSizereturns the size of the box at a position of aDataView, by the header rules of ISO/IEC 14496-12. The result is 0 for a truncated box. WithignoreUserType, the function returns the size of auuidbox with no completeusertypefield (#696).IsoRawBoxis the type of a box with no reader:{ type, bytes, headerSize, userType }.typeis the four-character code.bytesis the complete box, with its header (#682).IsoCustomBoxMapis an empty interface for the box types that the package does not name. Declare a box type in adeclare module '@svta/cml-iso-bmff'block.IsoBoxMap, the result ofreadIsoBoxes, and the write functions then have that box type.IsoCustomUuidBoxMapis an empty interface for the user types ofuuidboxes. A key is a UUID in lowercase hexadecimal digits with hyphens.IsoBoxMap['uuid']is the union of the declared box types. The testbox.userType === keynarrows auuidbox (#694).createUuidReadercreates the reader of theuuidkey from a map of user types. For a user type with no reader,readIsoBoxesreturns a raw box (#694).createUuidWritercreates the writer of theuuidkey from a map of user types. The writer writes the header andusertype, then calls the writer of the user type (#694).IsoBuiltInBoxMaphas the keyuuid. The type of the key isIsoUuidBox, the union of the box types ofIsoCustomUuidBoxMap(#694).IsoUuidBoxReaderandIsoUuidBoxWriterare the types of one function of the maps ofcreateUuidReaderandcreateUuidWriter.IsoUuidBoxReaderMapandIsoUuidBoxWriterMapare the types of the maps (#694).- The reader of the
uuidkey inIsoBoxReaderMapcan returnundefined.readIsoBoxesthen returns a raw box (#694). IsoBuiltInBoxMapis the map of the box types that the package names.IsoBoxMapis that map and the box types ofIsoCustomBoxMap.IsoBoxMapnow names the sample entry typesac-3,ac-4,av01,dav1,dva1,dvav,dvh1,dvhe,ec-3,fLaC,Opus, andvp09.AudioSampleEntryTypeandVisualSampleEntryTypehave the same types.createDefaultReaderConfigandcreateDefaultWriterConfighave a reader and a writer for these types (#686).writeAudioSampleEntryandwriteVisualSampleEntrynow take a sample entry of any box type. Thewritersmap takes each function under the key of a sample entry type.readAudioSampleEntryandreadVisualSampleEntryread a sample entry of any box type. Both functions have the parameters of a reader,(cursor, type). Thereadersmap takes each function under the key of a sample entry type, such as{ av01: readVisualSampleEntry }(#743).- The reading guide has the section "Changes in a minor release". A minor release can add a reader or a writer to a default configuration. It can also add a box type to
IsoBoxMap(#686, #687). createIsoBoxWriteCursorcreates a write cursor. The cursor is a plain object with a buffer that grows, and a position. Thecapacityoption sets the size of the first buffer. Thewritersoption sets the writers map of the cursor (#682).writeChildBoxeswrites boxes at the position of a write cursor, with the writers of the cursor. A custom writer of a box with child boxes calls the function (#682).- The write field functions write one field at the position of a write cursor and move the position past the field. The functions are
writeUint8,writeUint16,writeUint24,writeUint32,writeUint64,writeInt8,writeInt16,writeInt32,writeWideUint,writeWideInt,writeTemplate16,writeTemplate32,writeFourCc,writeBytes,writeUtf8, andwriteTerminatedUtf8(#682). - A write field function throws a
RangeErrorfor a value that its field cannot hold. The cursor does not move, and the message has the function, the values of the field, and the received value (#756). writeFourCcthrows aRangeErrorfor a code that does not have 4 characters, or has a character above U+00FF. The message has the received value (#682).writeTerminatedUtf8writes the text, then one null byte. The function throws aRangeErrorfor text with U+0000, because a read stops at that character (#682).beginIsoBoxandbeginIsoFullBoxwrite a box header with no size.endIsoBoxwrites the size into the header, so a writer does not compute the size.endIsoBoxthrows aRangeErrorfor a box above 2^32 - 1 bytes (#682).readStco,readStsc, andreadStszare new readers for thestco,stsc, andstszboxes (#619).readCo64andwriteCo64read and write theco64box. Each chunk offset has 64 bits and follows theint64option. The two default configuration functions include both functions, so aco64box is no longer a raw box (#652).readStz2andwriteStz2read and write thestz2box with entries of 4, 8, or 16 bits. For another field size, the reader returns no entries, and the writer throws aRangeError. The two default configuration functions include both functions (#652).IsoBoxReadConfighas a newint64option. The option takes a function that reads every 64-bit integer field of the built-in readers. With no option, the readers return the same values and the same types as before (#611).readInt64AsBigIntis a new function for theint64option. The built-in readers then return every 64-bit integer field as abigintwith the exact value. The result type ofreadIsoBoxesfollows the option (#611).createInt64OverflowReaderis a new function for theint64option. The built-in readers keepnumberfields. The function calls a callback with aRangeErrorwhen a 64-bit value is outside the safe integer range (#611).createDefaultReaderConfigtakes an optional argument with theint64option. The readers of the returned configuration have the types of that option (#611).writeWideUintandwriteWideIntwrite a field of 4 or 8 bytes from anumberor abigint. The functions throw aRangeErrorfor a value that does not fit the size (#611).LoudnessBox(ludt),RestrictedSchemeInfoBox(rinf),SubTrackDefinition(strd), andTrackGroupBox(trgr) are new container box types. Each type has a named reader and a named writer, such asreadRinfandwriteRinf(#748).IsoInt64Readeris the type of a function for theint64option. The function reads one field at the position of a read cursor.IsoInt64is the typenumber | bigintof a 64-bit integer field (#611).- Each container box type in
CONTAINERSnow has a named reader, such asreadMoovandreadMoof. A container reader in thereadersmap is optional and does not change the result.readVttcreads thevttcbox, andreadVttCreads thevttCbox (#297). - Each container box type in
CONTAINERSnow has a named writer, such aswriteMoovandwriteMoof. A container writer in thewritersmap is optional and does not change the written bytes.writeVttcwrites thevttcbox, andwriteVttCwrites thevttCbox (#297). TrackEncryptionBoxhas the new optional fielddefaultConstantIv, aUint8Arrayview of the input.readTencsets the field for atencbox with a constant IV (#648).TrackEncryptionBoxhas the new fielddefaultIsProtected, the protection state of the track.readTencreads the field, andwriteTencwrites it (#648).TrackEncryptionBoxhas the new optional fieldsdefaultCryptByteBlockanddefaultSkipByteBlock.readTencsets the fields for atencbox of version 1 or above (#648).writeTencnow writesdefaultCryptByteBlockanddefaultSkipByteBlockto atencbox of version 1 or above. With no pattern field, the writer throws aRangeError(#648).iterateChildBoxesyields the type and a new read cursor for each box from the position of a cursor to its end. The function parses no content and does not move the input cursor (#767).seekIsoBoxesfinds every box at a path, such as['moof', 'traf', 'tfdt'], and returns an array with a read cursor for each box. The function searches every box of each type in the path and decodes no box. The result is an empty array if the data has no box at the path (#771).seekIsoBoxsearches the next box of a type if a box of that type has no box at the rest of the path. The result is the first cursor thatseekIsoBoxesreturns for the same input (#771).- A cursor from
seekIsoBoxorseekIsoBoxeskeeps the nesting depth of its input. A custom reader that callsreadChildBoxeswith that cursor gets theRangeErrorof the limit of 128 levels (#771). resolveTrunSamplesreturns the duration, the size, the flags, and the composition time offset of each sample of atrunbox. A missing field takes the default of thetfhdbox, then of thetrexbox (#767).TrackRunSampleDefaultsis the type of the sample defaults forresolveTrunSamples. Thetfhdandtrexparameters accept a box or an object with only those defaults (#769).readTrunTotalsreads the number of samples of atrunbox and the sum of the sample durations, with no object for each sample. Use the function for the number of samples and the duration of a track fragment. The result type isTrackRunTotals(#772).
Changed
readTrunnow throws aRangeErrorbefore it creates the sample array when the sample records ofsample_countpass the end of the box. The message has the maximum count for the box and the received count (#767).- A
trunbox with none of the flags 0x000100 to 0x000800 now hassampleCountand nosamples.readTruncreates no sample objects for that box, so a large count no longer exhausts memory. Read the count assamples ? samples.length : sampleCount(#767). SampleSizeBoxis now a union of its two forms. A test ofentrySizenarrowssampleCountto a number (#767).trun,tfra, andssixno longer have count fields that repeat the length of a list. The removed fields aresampleCount,numberOfEntry,subsegmentCount, andrangesCount. The writers write the length of each list, so replacebox.sampleCountwithbox.samples.length(#682).sampleDependencyTableofsdtpis now aUint8Arraywith one byte for each sample. The array is a view of the input. For a write, wrap a list of numbers innew Uint8Array(...)(#715).- The built-in writers now throw a
RangeErrorfor a number that is not an integer of the range of its field. The fieldsversionandflagsfollow the same rule. Earlier releases write the low bits of the number, and 0 forNaN(#756). - The built-in writers now throw a
RangeErrorfor a field that a flag or the version selects when the box has no value for it, such assampleDurationoftrun. Earlier releases write 0 (#756). - The built-in writers now throw a
RangeErrorfor a byte field with no length, such as anArrayBuffer, and for an item that is not an integer from 0 to 255. Earlier releases write wrong bytes with no error (#756). writePsshandwriteTencnow throw aRangeErrorfor asystemId, a key ID, or adefaultKidthat does not have 16 bytes. Earlier releases write 0 for each missing byte and omit the extra bytes (#756).- The writers of a four-character code now throw a
RangeErrorfor a character above U+00FF. Earlier releases write the low byte of the character (#756). - The writers of a fixed-point field now throw a
RangeErrorfor a value outside the field, such as awidthof 65536 intkhd. Earlier releases write the low bits (#756). writeSidxnow throws aRangeErrorfor a reference field that does not fit its bits, such as areferencedSizeof 2^31 (#756).writeSidxnow throws aRangeErrorfor more than 65535 references, the limit of the 16-bitreference_count. Earlier releases write the low 16 bits of the count, so a read returns fewer references (#682).writeEmsgnow throws aRangeErrorfor aschemeIdUrior avaluewith U+0000. Earlier releases write the text after the U+0000 too, so a read returns wrong values for the later fields (#715).stts,stsc,stco,stss, andsubsno longer haveentryCount, and asubsentry no longer hassubsampleCount. The writers write the length of each list. Replacebox.entryCountwith the length of the list, such asbox.entries.length(#682).entryCountofcttsis now optional. The reader sets it only for a box of version 2 or above, which has no entries. For version 0 or 1, the count isbox.entries.length(#682).sampleCountofstszis now optional. The reader sets it only for a box with asampleSizeabove 0. With asampleSizeof 0, the count isbox.entrySize.length(#682).writeSubsnow throws aRangeErrorfor more than 65535 subsamples in one entry, the limit of the 16-bitsubsample_count. Earlier releases write the low 16 bits of the count (#682).ChunkLargeOffsetBoxnow has the type parameterVfor its 64-bit offsets.ChunkLargeOffsetBoxno longer hasentryCount, andCompactSampleSizeBoxno longer hassampleCount. Use the length ofchunkOffsetandentrySize(#652).elstno longer hasentryCount. The writer writes the length ofentries, so replacebox.entryCountwithbox.entries.length(#682).matrixofMovieHeaderBoxandTrackHeaderBoxis now a labeled tuple of 9 numbers, andopColorofVideoMediaHeaderBoxis a tuple of 3 numbers. An array that your code builds at run time needs a type annotation. A missing entry throws aRangeError(#715).writeFtyp,writeStyp, andwriteHdlrnow throw aRangeErrorfor a brand or ahandlerTypethat does not have 4 characters. Earlier releases move every later field for a code of 3 characters (#715).writeMdhdnow throws aRangeErrorfor alanguagethat is not 3 characters from U+0060 to U+007F. Earlier releases write 0 for a shorter value and keep 5 bits of each character, soen-USwritesenm(#715).writeHdlrnow throws aRangeErrorfor anamewith U+0000. Earlier releases write the text after the U+0000 too (#715).psshnow hassystemIdanddataasUint8Arrayviews of the input, andkidas aUint8Array[]with one 16-byte entry for each key ID.kidCountanddataSizeleave the type, and the writer writes the length of each list. Replacebox.kid.slice(i * 16, i * 16 + 16)withbox.kid[i](#715).defaultKidoftencis now aUint8Arrayview of the input.writeTencwrites the length ofdefaultConstantIvas the size of the constant IV. A constant IV above 255 bytes throws aRangeError(#715).dataFormatoffrmaandschemeTypeofschmare now four-character strings, such as'avc1'and'cenc'. ReplacedataFormat: 0x61766331withdataFormat: 'avc1'(#715).writeSchmnow throws aRangeErrorfor aschemeUriwith U+0000. Earlier releases write the text after the U+0000 too (#715).stsdanddrefno longer haveentryCount. The writers write the length ofboxes, so replacebox.entryCountwithbox.boxes.length(#682).readStsdandreadDrefnow throw aRangeErrorwhen the body has fewer complete child boxes thanentry_count. The message has the box type, the count, and the number of complete boxes. Earlier releases return the boxes that they find, with no error (#715).compressorNameof a visual sample entry is now a string, read as UTF-8. The writer writes the length byte, the UTF-8 bytes, and 0 to the end of the 32 bytes. A name above 31 bytes in UTF-8 throws aRangeError(#715).locationofurlandurnis now optional. The field isundefinedwhen the box has no more bytes.writeUrnwrites no string for the flag0x000001, and nolocationfor a box without one (#629).readVlab,readPayl,readIden, andreadSttgnow read the text to the end of the box, as ISO/IEC 14496-30 defines the text. A box that release 1.0.7 or earlier wrote ends in a null byte, so the read returns a trailing U+0000 (#715).prslno longer hasnumEntitiesInGroup. The writer writes the length ofentityId, so replacebox.numEntitiesInGroupwithbox.entityId.length(#682).writePrsl,writeLabl,writeKind, andwriteElngnow throw aRangeErrorfor a string with U+0000. Earlier releases write the text after the U+0000 too (#715).- Every built-in reader now takes a read cursor in place of an
IsoBoxReadView.readIsoBoxescalls a reader with the cursor and the box type. A custom reader has the typeIsoBoxReaderand returns the complete box with itstypefield. Replaceview.readUint(4)withreadUint32(cursor), andview.readFullBox()withreadUint8for the version andreadUint24for the flags (#682). - A box with no reader and a type outside
CONTAINERSis now a raw box:{ type, bytes, headerSize }. The body of the box isbox.bytes.subarray(box.headerSize), and it shares memory with the input. A rawuuidbox also hasuserType, a 16-byteUint8Array(#682). - A parsed box no longer has the fields
view,size,largesize, andusertype. A box object has onlytypeand its fields. To keep the bytes of a box, omit its reader and use the raw box (#682). - The user type of a raw
uuidbox is now the fielduserType. Earlier releases name the fieldusertypeon a parsed box. Replacebox.usertypewithbox.userType(#756). - The result type of
readIsoBoxesis nowParsedIsoBox<V>[]for every readers map. A test ofbox.typedoes not exclude a raw box, so narrow a box withisIsoBoxType. Replaceif (box.type === 'tfdt')before a field read withif (isIsoBoxType('tfdt', box))(#682). readIsoBoxesandcreateDefaultReaderConfigare now generic functions with one signature.ReturnType<typeof readIsoBoxes>now hasnumber | bigintfields. Use the typesParsedIsoBox[]andIsoBoxReadConfigin place of the utility types (#611).readStsdno longer has a type parameter for the entry type. The entries ofSampleDescriptionBoxnow includeIsoRawBoxby default, andwriteStsdaccepts the result ofreadStsd. ReplacereadStsd<Avc1Box>withreadStsd, and narrow an entry withisIsoBoxType(#682).isContainernow takes any box, such as a raw box or the result of a custom reader. The function returnsfalsefor a raw box (#682).- A
trueresult ofisContainernow narrows a box to the box types with aboxesfield. These types are the container types,meta,stsd,dref,prsl, and the sample entries. The result also keeps a box type with a type inCONTAINERSand noboxesfield. The run-time result does not change (#715). - The
boxesfield of every box type is nowParsedIsoBox<V>[], a box type or a raw box. Narrow a child withisIsoBoxType. A child that is a byte array becomes a raw box, such as{ type: 'esds', bytes }(#682). - The box types with child boxes now all have the type parameter
Vfor the 64-bit integer fields of the children. The new parameter is onDataInformationBox,DataReferenceBox,MediaInformationBox,PreselectionGroupBox,ProtectionSchemeInfoBox,SampleTableBox,SchemeInformationBox,TrackReferenceBox, andWebVttCueBox. The default isnumber(#682). AudioSampleEntryandVisualSampleEntryhaveVas a second type parameter.SampleEntryhasVin place of the child typeC. ReplaceSampleEntry<T, MyChild>withSampleEntry<T>(#682).SampleDescriptionBoxnow hasVas the first type parameter, and the entry typeEas the second. ReplaceSampleDescriptionBox<MyEntry>withSampleDescriptionBox<number, MyEntry>(#682).- The readers of the box types with child boxes, such as
readDinf,readStsd, andreadAvc1, are now generic functions inV(#682). Boxno longer has a default type argument. ReplaceBoxwithBox<'abcd'>for one box type, or withIsoBox(#682).IsoBoxStreamableis now the union of the box types ofIsoBoxMap,IsoRawBox, andArrayBufferView.ParsedBoxis no longer a member (#682).writeIsoBox,writeIsoBoxes,writeChildBoxes, andcreateIsoBoxReadableStreamnow check a box object against its box type. A box object with a missing field is a compile error. A box object with atypeoutsideIsoBoxMapis also a compile error (#682).isIsoBoxTypenow returnsfalsefor a raw box. Its first signature takesIsoBox<V> | { type: string } | null | undefined(#682).readIsoBoxesnow checks the size of a box before it calls the reader of that box. The function does not catch an error of a reader. An error of a reader now always reaches the caller. The errorTruncated boxno longer exists (#682).readIsoBoxesandreadChildBoxesnow throw aRangeErrorfor a box that is deeper than 128 levels. The message has the box type and the limit. Earlier releases end with a stack overflow of the engine for a very deep input (#682).- The cursor of a reader for a
uuidbox now starts at the first byte ofusertype. The reader reads the 16 bytes ofusertypewithreadBytes(#682). IsoBoxReadernow has the type parametersBandV, andBmust have atypefield.IsoBoxReaderMapnow takes a key ofIsoBoxMaponly, and a reader returns the box type of that key. The keysurlandurnfind the readers of'url 'and'urn '(#682).- Every built-in writer now takes a write cursor and the box, and returns nothing. A custom writer has the same signature. Replace
new IsoBoxWriteView(type, size)withbeginIsoBox(cursor, type), the write field functions, andendIsoBox(cursor, start)(#682). - The writers of boxes with child boxes, such as
writeStsdandwriteMoov, no longer have aconfigparameter. They write the child boxes with the writers of the cursor (#682). IsoBoxWriterMapnow takes a key ofIsoBoxMaponly, and a writer takes the box type of that key. The keysurlandurnfind the writers of'url 'and'urn '(#682).writeIsoBoxesnow returns oneUint8Arraywith every box, in place of one array for each box. Remove the code that joins the arrays (#682).writeIsoBoxesandwriteIsoBoxnow always return a new array. Earlier releases return a view of the input buffer for anArrayBufferViewinput (#682).writeIsoBoxesnow copies the bytes of a box with abytesfield, such as a raw box, before it looks for a writer. To change a raw box, build a box object with the fields and nobytesfield (#682).writeIsoBoxesnow copies each top-levelArrayBufferViewand raw box of anArrayinput one time, into the result.writeIsoBoxhas the same change. A write of a segment whose bytes are mostly rawmdatboxes now allocates about the size of the output (#777).- In
writeIsoBoxesandwriteIsoBox, thecursor.posof a writer no longer counts the earlier top-level raw boxes, andcursor.bytesno longer holds them. A custom writer reads and writes only the bytes of its own box (#777). createIsoBoxReadableStreamnow writes one box for each read and writes no box before the first read. The stream writes every box into one buffer, which keeps the size of the largest box until the stream ends. An error of the first box now rejects the first read. Earlier releases throw the error from the call (#682).writeIsoBoxesandwriteIsoBoxnow throwNo writer found for box typefor a box object with a reader, no writer, and a type outsideCONTAINERS. Earlier releases write the source bytes of theviewfield. Add the writer of the type, or remove the reader so that the box stays a raw box (#682).- The box types with 64-bit integer fields have a new type parameter for the type of those fields. The container types of those boxes,
ParsedIsoBox,IsoBoxReadCursor, and the related types have the same parameter. The default isnumber, so existing references do not change (#611). - The built-in readers of boxes with no 64-bit integer field take
IsoBoxReadCursor<IsoInt64>. That type accepts a cursor withnumberfields orbigintfields (#611). - The readers of the boxes with 64-bit integer fields, such as
readTfdt, are now generic functions.ReturnType<typeof readTfdt>now hasnumber | bigintfields. Use the box type, such asTrackFragmentBaseMediaDecodeTimeBox, orReturnType<typeof readTfdt<number>>(#611). Parameters<typeof readTfdt>[0]isIsoBoxReadCursor<IsoInt64>. Use the typeIsoBoxReadCursorin place of that utility type (#611).isIsoBoxTypenow narrows a box withbigintfields to the built-in box type withbigintfields. A box that can benullorundefinednarrows in the same way (#611).- The writers of the boxes with 64-bit integer fields now take a box with
numberfields orbigintfields.writeIsoBox,writeIsoBoxes, andcreateIsoBoxReadableStreamtake the same boxes. A box thatreadIsoBoxesreads withreadInt64AsBigIntwrites back with the exact values (#611). Parameters<typeof writeTfdt>[1]now hasnumber | bigintfields. The other eleven writers of boxes with 64-bit integer fields,writeIsoBox, andwriteIsoBoxeshave the same change. Use the box type, such asTrackFragmentBaseMediaDecodeTimeBox, orIsoBoxStreamable(#611).- With
readInt64AsBigInt, a custom reader of the type(cursor: IsoBoxReadCursor) => ...is a compile error. Type the cursor asIsoBoxReadCursor<IsoInt64>, or make the reader generic and callreadWideUint(#611). Required<IsoBoxReadConfig>now has a requiredint64key. A value of that type with noint64function is a compile error. UseRequired<Pick<IsoBoxReadConfig, 'readers'>>for a configuration with required readers (#611).- The reading guide has a section on a function that forwards the
int64option. The guide also states thatJSON.stringifythrows aTypeErrorfor abigint(#611). UserDataBox,GroupsListBox,SubTrack,AdditionalMetadataContainerBox, andMetaBoxnow have the type parameter for the type of the 64-bit integer fields. The default isnumber, so existing references do not change (#646).readMetais now a generic function, soReturnType<typeof readMeta>isMetaBox<number | bigint>. Use the typeMetaBoxin place of that utility type (#646).writeMetanow takes aMetaBoxwithnumberfields orbigintfields (#646).- A
udta,grpl,strk, ormecobox no longer accepts a child of another type, such as aUint8Array. Give that child as a raw box withtypeandbytes(#646). writeIsoBoxandwriteIsoBoxesnow throwNo writer found for box typefor a box object with no writer and a type outsideCONTAINERS, such as ametabox. Earlier releases write only the header and the child boxes of such a box, so its other fields are lost. Add the writer for the type, such aswriteMeta, to thewritersmap (#651).CONTAINERSnow has the typesludt,rinf,strd, andtrgr.readIsoBoxesreturns such a box with its child boxes inboxes, not as a raw box withbytes(#748).CONTAINERSis now areadonly string[]. A call ofpushis a compile error. To read another container box, add a reader that callsreadChildBoxes(#748).- The reading guide and the writing guide now state that
CONTAINERSlists the container box types that the functions read and write automatically (#748). - The built-in readers now return every key of the box type. A field that the flags, the version, or the size of the box excludes is
undefined. The changed readers arereadUrl,readUrn,readCtts,readStsz,readEmsg, andreadTenc. A test such as'location' in boxis nowtruefor every box. Test the value forundefined(#749). - The reading guide has a section on optional fields. The section states that a test of the key with
indoes not show whether the box has the field (#749). readTrunnow gives every sample the four keyssampleDuration,sampleSize,sampleFlags, andsampleCompositionTimeOffset. A field that the flags exclude isundefined.'sampleDuration' in sampleis nowtruefor every sample. Test the flags of the box, or test the value forundefined(#746).readTrunnow tests the flags one time for each box, not for each sample. A box with many samples reads faster (#746).EventMessageBoxis now one type withversion: number, like the other box types.presentationTimeDeltaandpresentationTimeare optional. A check ofversionno longer narrows the type of a time field. Read the field of the version, such asbox.presentationTimeDelta ?? box.presentationTime(#751).- The documentation of
writeTemplate16andwriteTemplate32now describes a fixed-point value. The documentation states the size of each field. Both functions write an unsigned field. - The documentation of the
matrixfield ofMovieHeaderBoxandTrackHeaderBoxnow states the entry order and the identity matrix. The documentation also states the stored formats. - The documentation of the
balancefield ofSoundMediaHeaderBoxnow states the values for full left, center, and full right. - The reading guide has a section on extending a built-in reader. The example decodes the ID3 frames of an
emsgbox. isIsoBoxTypeacceptsunknownas the box argument instead ofany. The guard now also returnsfalsefornulland for values that are not objects.writeIsoBoxandwriteIsoBoxesnow returnUint8Array<ArrayBuffer>. The result passes toSourceBuffer.appendBufferwithout a cast under TypeScript 6 and later. A box given as a view over aSharedArrayBufferis copied, so the result is always backed by anArrayBuffer. The type declarations now need TypeScript 5.7 or later.createIsoBoxReadableStreamnow returnsReadableStream<Uint8Array<ArrayBuffer>>, the result type ofwriteIsoBox(#682).- The README now has a When to use section. The section names the tasks that the package covers and the entry point of each task.
- The utilities guide example now stores the result of
isContainerincontainer. The example no longer redeclares the imported name. - Every code example in the guides now typechecks. The writing examples pass each
Uint8ArraytoappendBufferdirectly, and thetraverseIsoBoxesexample reads the boxes first (#565). - The reading guide has a section on incomplete boxes, and the writing guide links to that section. The documentation of
readIsoBoxesandreadChildBoxesstates where the read stops (#650). - The reading guide now states that a box with a size below the size of the box header is incomplete. The documentation of
readIsoBoxesandreadChildBoxesstates the same rule (#663). - The reading guide now states the position of the cursor after
readChildBoxesornextIsoBoxstops before an incomplete box. The guide also states the two limits of that position (#693). - The README no longer states that
readStsdreads the codec. The function reads the sample entry type, such asavc1. The reading guide states that the package parses no codec configuration box, such asavcC(#687). - The README and the
homepagefield ofpackage.jsonnow link to the package page on the website, cml.svta.org/packages/iso-bmff. writeElng,writeIden,writeKind,writeLabl,writePayl,writeSttg, andwriteVlabnow encode each string one time. The written bytes ofwriteElng,writeKind, andwriteLabldo not change (#632).writePrslnow encodes each tag one time. The written bytes do not change.- The reading guide now states that the header of a
uuidbox has 16 more bytes for theusertypefield. writeEmsg,writeHdlr,writeUrl,writeUrn, andwriteSchmnow needTextEncoder, as the other UTF-8 writers do. Earlier releases write these boxes with noTextEncoder(#643).readTfranow computes the size of the 64-bit integer fields one time for each box.writeTkhdnow writeslayerandalternateGroupas signed integers, asreadTkhdreads them. The written bytes do not change.- The examples of
readIsoBoxes,writeIsoBoxes,traverseIsoBoxes, andcreateIsoBoxReadableStreamnow usestrictEqualanddeepStrictEqual. ThewriteIsoBoxesexample compares the written bytes with aUint8Arrayof the file. - The README has a quick start with one read example and one write example. A new section lists the runtime APIs that some exports need.
- The reading guide states that
readIsoBoxesthrows aRangeErrorfor a complete box with a body shorter than its fields. The guide also states the rules for the input types and shared byte fields. - The reading and writing guide examples find a
tfdtbox withfindIsoBox. The earlier examples looked for the box at the top level, where a segment does not have it. - The
bigintexample of the reading guide keeps the fraction of the seconds. The guide also states that an all-onesdurationreports an overflow tocreateInt64OverflowReader. - The writing guide states the exact keys of the
writersmap and the rule for flags and missing fields. TheappendBufferexamples wait for theupdateendevent. - The utilities guide describes the configuration of
traverseIsoBoxesand has a section onfindIsoBox,filterIsoBoxes, andisIsoBoxType. - The documentation of
readIsoBoxes,writeIsoBox,writeIsoBoxes, andcreateIsoBoxReadableStreamnow has@throwstags. - The summary of each reader and writer names the four-character type of its box. The summary of each box type uses one form and cites ISO/IEC 14496-12:2015 where that edition defines the box.
- The documentation of the
mvhd,tkhd,mdhd,mehd,elst,mfro,tfhd, andtfrafields states the units, the 1904 epoch, and the flags. Byte fields state that they are a view over the input. - 41 readers and writers and 52 other exports now link a test example. Each linked example declares its input, except the example of
writeIsoBoxes. readIsoBoxesandreadChildBoxesare faster for a box with no reader, such as a container box or a raw box. The result does not change.readIsoBoxes,readChildBoxes,iterateChildBoxes,nextIsoBox, andreadFourCcnow keep the strings of four-character codes in a cache of 128 entries. Every reader that calls one of these functions also uses the cache, such asreadMoov,readTraf, andreadFtyp. A tree read creates fewer strings and is faster, and the result does not change (#766).traverseIsoBoxesis faster. The largest gain is in breadth-first order over many sibling containers. The order of the boxes does not change (#706).writeCttsandwriteTrunnow write the signed offset fields as signed integers, asreadCttsandreadTrunread them. The written bytes do not change.IsoBoxTypeis now declared asstring. The type accepts the same values as before. The documentation states that TypeScript does not check the length of a box type.readVtteandwriteVttenow name their unused parameters with a_prefix, and the documentation describes the parameters.- The documentation of
readInt64AsBigIntand the reading guide now test forDataView.prototype.getBigUint64. A runtime can haveBigIntand nogetBigUint64method. The documentation ofreadUint64,writeUint64,writeWideUint, andwriteWideIntnames theDataViewmethod that each one needs. - The runtime requirements table of the README now lists the
DataViewmethods that thebigintreads and writes need. - The description of the package now states that the package reads and writes boxes.
- The UTF-8 string reads now call
decodeUtf8of@svta/cml-utils. A bundle withreadIsoBoxesis about 200 bytes smaller after gzip. The results do not change. The package now needs@svta/cml-utils1.8.0 or later. writeIsoBoxesandcreateIsoBoxReadableStreamnow take an optional configuration, aswriteIsoBoxdoes. With no configuration, a write takes only containers, byte arrays, and raw boxes (#715).- The
writersfield ofIsoBoxWriteConfigis now optional. A call with{ writers: {} }still compiles.createDefaultWriterConfigstill returns the map (#715). SampleDescriptionBoxandDataReferenceBoxnow keep their child boxes inboxes, not inentries. Replacestsd.entrieswithstsd.boxes, anddref.entrieswithdref.boxes(#715).findIsoBox,filterIsoBoxes, andtraverseIsoBoxesnow reach the sample entries ofstsdand the data entries ofdref, if the configuration hasreadStsdorreadDref. A predicate that matches a type inside those boxes, such ashvc1, now finds that box (#715).isContainernow returnstruefor astsdbox and adrefbox, because both boxes now have aboxesfield. Earlier releases returnfalse(#715).- The exported names of box types, entry types, and fields now follow the names of the specification. The configuration types and functions also have new names. The rename table after this list shows each old name and its new name. The compiler reports each old name (#715).
SyncSampleBoxnow has the fieldsampleNumber: number[]in place ofentries. Replacebox.entries.map((entry) => entry.sampleNumber)withbox.sampleNumber. In a box that code builds, replaceentries: [{ sampleNumber: 1 }]withsampleNumber: [1](#715).PreselectionGroupBoxnow has the fieldentityId: number[]in place ofentities. Replacebox.entities.map((entity) => entity.entityId)withbox.entityId. In a box that code builds, replaceentities: [{ entityId: 1 }]withentityId: [1](#715).- The type parameter of
TypeBoxnow accepts only'ftyp'and'styp'(#715). AudioSampleEntrynow has the optional fieldentryVersion, from the first 16 bits afterdataReferenceIndex.writeAudioSampleEntrywrites 0 for a missing value (#715).- The
pre_definedfields ofhdlr,mdhd,mvhd, and the sample entries are now optional. A writer writes 0 for a missing value, and -1 for a missingpreDefined3of a visual sample entry (#715). - The
reservedfield ofHandlerBoxis now optional.writeHdlrwrites 0 for a missing value (#715). - The writers now write 0 in each reserved field, except
reservedofhdlr. If a source box has another value in a reserved field, the writer writes 0 there (#715). writeSidx,writeSubs, andwriteTencreport a count above the limit with the message of the other range checks. An example issidx references.length must be an integer from 0 to 65535, received 65536(#776).writeWideIntreports abigintthat does not fit with the textmust be an integer that fits in 4 bytes(#776).
Renames of version 2.0.0:
| Version 1 | Version 2.0.0 |
|---|---|
HandlerReferenceBox | HandlerBox |
DecodingTimeToSampleBox | TimeToSampleBox |
CompositionTimeToSampleBox | CompositionOffsetBox |
ProtectionSchemeInformationBox | ProtectionSchemeInfoBox |
TrackKindBox | KindBox |
SubsampleInformationBox | SubSampleInformationBox |
SubTrackBox | SubTrack |
SampleEntryBox, AudioSampleEntryBox, VisualSampleEntryBox | SampleEntry, AudioSampleEntry, VisualSampleEntry |
writeAudioSampleEntryBox | writeAudioSampleEntry |
writeVisualSampleEntryBox | writeVisualSampleEntry |
DecodingTimeSample | TimeToSampleEntry |
CompositionTimeToSampleEntry | CompositionOffsetEntry |
SubsampleEntry, Subsample | SubSampleInformationEntry, SubSampleInformationSubsample |
Subsegment, SubsegmentRange | SubsegmentIndexSubsegment, SubsegmentIndexRange |
channelcount, samplesize, samplerate | channelCount, sampleSize, sampleRate |
horizresolution, vertresolution | horizResolution, vertResolution |
graphicsmode, opcolor | graphicsMode, opColor |
defaultIvSize | defaultPerSampleIvSize |
IsoBoxReadViewConfig, IsoBoxWriteViewConfig | IsoBoxReadConfig, IsoBoxWriteConfig |
defaultReaderConfig, defaultWriterConfig | createDefaultReaderConfig, createDefaultWriterConfig |
A field rename also changes the keys of a box that readIsoBoxes returns. Code that reads a field by a string key gets no compile error.
Removed
fourCcToUint32is removed. No field of version 2.0.0 stores a four-character code as a number. To convert a code, computenew DataView(Uint8Array.from(code, char => char.charCodeAt(0)).buffer).getUint32(0)(#715).IsoBoxReadViewis removed. A custom reader reads the fields with the read field functions on a read cursor.view.bytesRemainingbecomescursor.end - cursor.pos,view.jump(size)becomescursor.pos += size,view.readBoxes()becomesreadChildBoxes(cursor), andview.readBox()becomesnextIsoBox(cursor)orreadChildBoxes(cursor, 1)(#682).IsoBoxWriteViewis removed. A custom writer writes the fields with the write field functions on a write cursor.writer.writeUint(value, 4)becomeswriteUint32(cursor, value), andwriter.writeFullBox(version, flags)becomesbeginIsoFullBox(cursor, type, version, flags)(#682).- The child types are removed:
AdditionalMetadataContainerBoxChild,AudioSampleEntryBoxChild,DataInformationBoxChild,EditBoxChild,GroupsListBoxChild,MediaBoxChild,MediaInformationBoxChild,MetaBoxChild,MovieBoxChild,MovieExtendsBoxChild,MovieFragmentBoxChild,MovieFragmentRandomAccessBoxChild,PreselectionGroupBoxChild,ProtectionSchemeInformationBoxChild,SampleTableBoxChild,SchemeInformationBoxChild,SubTrackBoxChild,TrackBoxChild,TrackFragmentBoxChild,TrackReferenceBoxChild,UserDataBoxChild,VisualSampleEntryBoxChild, andWebVttCueChild. UseParsedIsoBox(#682). TrackReferenceTypeBoxis removed, because no reader returns that type. A child of atrefbox is a raw box (#715).IsoBoxReaderReturnis removed. The result type ofreadIsoBoxesisParsedIsoBox<V>[](#682).IsoFieldTypeMapis removed. A reader or a writer reads or writes an array of values with a loop (#682).ParsedBoxandIsoTypedParsedBoxare removed, because a parsed box has noviewand nosize.ParsedIsoBoxis the type of a box thatreadIsoBoxesreturns (#682).IsoBoxMapand the child box types no longer have the 16 box types with no reader and no writer. The removed box types arehmhd,iinf,iloc,imif,infe,ipro,iref,nmhd,pitm,saio,saiz,sbgp,senc,sgpd,stdp, andstsh. To read one of these boxes, declare its type and add a custom reader (#715).- The package no longer exports the types of the 16 removed box types, such as
SampleEncryptionBoxandItemInfoEntry. The entry types of those boxes, such asEncryptedSampleandItemLocation, are also removed (#715). - The type aliases
co64,stz2,url, andurnare removed. UseChunkLargeOffsetBox,CompactSampleSizeBox,DataEntryUrlBox, andDataEntryUrnBox, or a key ofIsoBoxMapsuch asIsoBoxMap['co64'](#715). - The constants
UINT,INT,TEMPLATE,STRING,UTF8,DATA, andIsoBoxFieldsare removed. A custom reader calls a read field function, such asreadUint32(#715). - The class
IsoBoxReadableStreamis removed. Replacenew IsoBoxReadableStream(boxes, config)withcreateIsoBoxReadableStream(boxes, config)(#715). - The entry types
SyncSampleandEntityare removed. An element ofsampleNumberand ofentityIdis anumber(#715). isFullBoxis removed. Test the fields of the box, such as'version' in box && 'flags' in box, or test the box type withisIsoBoxType(#715).- The box types no longer have the
reservedfields of the specification. Removereserved1,reserved2, andreserved3frommvhd,tkhd, and the sample entries. Removereservedfromsmhd,sidx, andtfra(#715). TrackEncryptionBoxno longer hasdefaultIsEncrypted. ReplacedefaultIsEncrypted: 1withdefaultIsProtected: 1, and set the pattern withdefaultCryptByteBlockanddefaultSkipByteBlock(#715).LabelBoxno longer hasisGroupLabel. Replacebox.isGroupLabelwith(box.flags & 0x1) !== 0(#715).readAudioSampleEntryBoxandreadVisualSampleEntryBoxare removed. ReplacereadAudioSampleEntryBox(type, view)withreadAudioSampleEntry(cursor, type). The cursor is the first argument (#743).createAudioSampleEntryReaderandcreateVisualSampleEntryReaderare removed. In areadersmap, replacecreateVisualSampleEntryReader('av01')withreadVisualSampleEntry. A direct call isreadVisualSampleEntry(cursor, 'av01')(#743).EventMessageBoxBase,EventMessageBoxV0, andEventMessageBoxV1are removed. UseEventMessageBox(#751).SegmentIndexReferenceno longer has the packed fieldsreferenceandsap. Use the decoded fields, such asreferenceTypeandsapType(#715).
Fixed
writeTfranow throws aRangeErrorfor a length size above 3. Earlier releases write that length size into the reserved bits, so the entries do not match the header.- The published package includes
NOTICE.md. readKind,readLabl, andreadPrslnow return the correct fields after a string with multi-byte characters. Earlier releases return an emptyvaluefor akindbox with theschemeUriurn:é(#630).readDrefandreadStsdnow return an emptyboxeslist for anentry_countof 0. A write of the box then keeps the count of 0 and writes no entries. Earlier releases return the boxes after the count, so a write changes the count to the number of those boxes (#666).- The
hdlr,url,urn, andschmreaders and writers now use UTF-8 for thename,location, andschemeUristrings. Earlier releases returnå,for anameof日本afterwriteHdlrandreadHdlr(#631). writeSchmnow writes the null terminator of an emptyschemeUriwhen flag0x000001is set. A missingschemeUrithrows aRangeError(#628).readElstnow returns the correctmediaTimefor a version 1elstbox, where -1 marks an empty edit. Earlier releases return -4294967297 for -1.writePrslnow writes every tag that the flags declare. The writer writes an empty string for an emptypreselectionTagorinterleavingTag, and throws aRangeErrorfor a missing tag. Earlier releases omit an empty tag, and a read of the written box returns no child boxes (#624).createDefaultReaderConfig()now includes readers for thestco,stsc, andstszboxes.writeIsoBoxeswithcreateDefaultWriterConfig()now writes thestco,stsc, andstszboxes thatreadIsoBoxesreads withcreateDefaultReaderConfig(). Earlier releases throw aRangeErrorforstcoandstsc, and writestszwithout the sample sizes (#619).writeUrlno longer writes thelocationstring when flag0x000001is set, even whenlocationis not empty. Earlier releases add a null byte, so theurlbox and the enclosingdrefbox are one byte too long (#623).writeIden,writePayl,writeSttg, andwriteVlabnow write the string of the box with no null byte after the string. Earlier releases write a null byte after the string (#636).- The built-in readers now return the correct fraction of
rate,volume,matrix,width,height,horizResolution,vertResolution, andsampleRate. Earlier releases return 8193 for the bytes00 01 80 00of a 16.16 value, and the correct value is 1.5. readMvhdnow readsrateas a signed value. Arateof -1 now reads as -1. Earlier releases return 65535 for thisrate.readMvhdandreadTkhdnow readvolumeandmatrixas signed values. Amatrixentry of -1, as in a rotated video, now reads as -1. Earlier releases return 65535 for this entry.readTkhdnow readslayerandalternateGroupas signed values. Alayerof -1 now reads as -1. Earlier releases return 65535 for thislayer.readMvhdandreadTkhdnow read thematrixentries u, v, and w (indexes 2, 5, and 8) as 2.30 values. The entry w of the identity matrix now reads as 1. If your code compares w with 16384, compare w with 1.writeMvhdandwriteTkhdnow write thematrixentries u, v, and w as 2.30 values. If your code passes 16384 for w, pass 1. The value 16384 now throws aRangeError.readSmhdnow readsbalanceas a signed 8.8 value. Thebalancefor full right reads as 1, and thebalancefor full left reads as -1. Earlier releases return 256 for full right and 65280 for full left.writeSmhdnow writesbalanceas a signed 8.8 value. If your code passes 256 for full right, pass 1. The value 256 now throws aRangeError.readEmsgandwriteEmsgnow read and writeschemeIdUriandvalueas UTF-8, as ISO/IEC 23009-1 defines the fields. Earlier releases use one byte for each character, so a character that is not ASCII gives wrong bytes or a wrong string. A string with only ASCII characters reads and writes the same bytes as before (#643).readIsoBoxesno longer throws aRangeErrorwhen the data ends inside a box header. The function returns the boxes before that header. The function now reads a sample entry or audtabox with 4 zero bytes after the last child box (#650).writeIsoBoxesomits the bytes thatreadIsoBoxesstops before. The written box is shorter than the source box by those bytes. If themoovbox precedes themdatbox, the chunk offsets of the written file then address other bytes (#650).readIsoBoxesnow stops before a box with a size below the size of the box header. The function returns the boxes before that box. Earlier releases return boxes with wrong types, omit the next box, or throw aRangeError(#663).readIsoBoxesnow returns for a box with asizeof 1 and alargesizeof 0. Earlier releases read that box again without end, and the memory use grows (#663).readIsoBoxesnow stops before auuidbox with a size below 24, or below 32 with alargesizefield. The function returns the boxes before that box. Earlier releases throw aRangeErrorwhen that box is the last box of the data or of a container.readPsshandwritePsshnow read and write 16 bytes for each key ID of a version 1psshbox. Thekidfield has one 16-byteUint8Arrayfor each key ID. Earlier releases use one byte for each key ID, soreadPsshreturns a wrongdataSizeanddataor throws aRangeError(#649).writeTencnow writes the constant IV of atencbox that hasdefaultConstantIv. A read and then a write of the box returns the source bytes. Earlier releases write 32 bytes and drop the constant IV (#648).- The children of the
udta,grpl,strk, andmecoboxes now have the typeParsedIsoBox. Earlier releases give each child the typeany, so TypeScript checks no field of a child. Narrow a child withisIsoBoxTypebefore you read a field of the child (#646). - After
isContainer(box), each element ofbox.boxesnow has the typeParsedIsoBox, a box type or a raw box. A 64-bit integer field of a child has the type of theint64option (#646). readEmsgnow returns the source version for anemsgbox of version 2 or above.messageDatahas all bytes after the full box fields. The strings are empty, the numbers are 0, and both time fields areundefined. Earlier releases read the fields of version 0 and returnversion: 0(#667).writeEmsgnow writes only the full box fields andmessageDatafor aversionother than 0 or 1. A read and then a write of such a box return the source bytes. Earlier releases write the fields of version 1 (#667).writeWideUint(cursor, value, 8)and the built-in writers now write all bits set for thenumber2^64. Earlier releases write 0. A read and then a write with the default configs now keep a 64-bit field with all bits set, such asdurationinmvhd(#653).readSidxandwriteSidxnow read and writeearliestPresentationTimeandfirstOffsetas 64-bit fields for asidxbox of version 2 or above. Earlier releases use 32-bit fields for every version other than 1 (#670).readPrftandwritePrftnow read and writemediaTimeas a 64-bit field for aprftbox of version 2 or above. Earlier releases use a 32-bit field for every version other than 1 (#670).readCttsnow returnsentryCountand an emptyentrieslist for acttsbox of version 2 or above. The syntax defines no entries for those versions. Earlier releases read the entries with the layout of version 0 (#670).writeCttsnow writesentryCountand no entries for acttsbox of version 2 or above. Earlier releases write every element ofentriesfor every version (#670).readTrunnow readssampleCompositionTimeOffsetas a signed integer for atrunbox of version 2 or above. Earlier releases read a signed integer only for version 1 (#678).readIsoBoxesnow reads anArrayBufferfrom another realm, such as anode:vmcontext or an iframe. Earlier releases throw aTypeErrorfor thatArrayBuffer.createIsoBoxReadableStreamnow closes the source iterator when the stream is canceled. Thefinallyblock of a generator source now runs. Earlier releases leave the iterator open.createIsoBoxReadableStreamnow reads the globalReadableStreamwhen it is called. AReadableStreampolyfill that a player installs after the import now works (#715).
1.0.7 - 2026-10-18
Changed
- Type parameter names in
dist/index.d.tsnow match the source, for exampleTinstead ofT$1. - README and the Reading Boxes, Writing Boxes, and Utilities guides: the prose is rewritten for readers who do not read English as a first language. The code examples are unchanged.
- Peer dependency ranges are now caret ranges, for example
^1.6.2instead of1.6.2. A later patch or minor release of a peer no longer requires a new release of this package.
1.0.6 - 2026-09-15
Changed
- Update
@svta/cml-utilsto 1.6.1
1.0.5 - 2026-08-11
Fixed
writeTerminatedStringnow writes the null terminator for empty strings, sowriteEmsgoutput with an emptyvalueorschemeIdUrino longer misaligns the fields that follow (version 1messageDatalost its head to thevalueread; version 0 numeric fields were garbled) (#411)
1.0.4 - 2026-07-28
Changed
- Update
@svta/cml-utilsto 1.6.0
1.0.3 - 2026-07-21
Fixed
IsoBoxReadableStreamno longer reads the bareReadableStreamglobal at module scope: importing the package never throws on runtimes without the Web Streams API. InstantiatingIsoBoxReadableStreamon such runtimes throws a descriptive error instead (#382)
1.0.2 - 2026-05-13
Changed
- Update
@svta/cml-utilsto 1.5.0
1.0.1 - 2026-02-11
Fixed
- Loosen typed array generic parameters across public API types and utilities
Changed
- Update
@svta/cml-utilsto 1.4.0
1.0.0 - 2026-02-09
Official stable release. No changes since 1.0.0-beta.2.
1.0.0-beta.2 - 2026-02-03
Changed
- Update
@svta/cml-utilsto 1.2.0
1.0.0-beta.1 - 2026-01-29
Added
- Added writers:
stsc,stsz,stco. - Added
defaultReaderConfiganddefaultWriterConfigfunctions to create default reader and writer configurations (#298)
Changed
- Made
IsoBoxWriteViewConfigrequired inwriteIsoBoxesfunction (#298)
1.0.0-alpha.9 - 2026-01-16
Added
- Added
fourCcToUint32utility function to convert FourCC strings to Uint32
1.0.0-alpha.8 - 2026-01-16
Added
- Added
favicon.icoto documentation - Added
isIsoBoxTypetype guard function
Changed
- Allow type guards to be used with
findIsoBoxandfilterIsoBoxes - Improved base
SampleEntryBoxtype - Updated box reader functions to allow a type parameter to be passed in
1.0.0-alpha.7 - 2026-01-12
Fixed
- Bad publish
1.0.0-alpha.6 - 2026-01-09
Added
- Added
IsoBoxFieldsconstant for all ISO BMFF field types - Exports for
IsoBoxReadViewandIsoBoxWriteView
Changed
- Moved all field constants to
IsoBoxFields.ts
Fixed
- Broken type inference for
createAudioSampleEntryReaderandcreateVisualSampleEntryReader - Broken type inference for
writeIsoBoxes
1.0.0-alpha.5 - 2026-01-08
Fixed
- Broken type inference for
traverseIsoBoxes,findIsoBox, andfilterIsoBoxes
1.0.0-alpha.4 - 2026-01-08
Added
- Added ability to use generic reader functions with
readIsoBoxes - Added
createAudioSampleEntryReaderandcreateVisualSampleEntryReaderutility functions for custom audio and visual sample entry box types - Added
findIsoBoxutility function to find the first box matching a predicate - Added
filterIsoBoxesutility function to filter boxes matching a predicate - Added
TraverseIsoBoxesConfigtype for configuring box traversal options
Changed
- Improved type inference for reader return types
- Changed
traverseIsoBoxesto accept a config object instead of positional arguments fordepthFirstandmaxDepth - Expanded
AudioSampleEntryBoxandVisualSampleEntryBoxtype parameters to accept anyIsoBoxType
1.0.0-alpha.3 - 2026-01-07
Changed
- Improved reading and writing of A/V sample entry boxes
Fixed
- Incorrect FourCC for Additional Metadata Container Box (
meco) box
1.0.0-alpha.2 - 2026-01-05
Added
- Add
stsdanddrefbox writers - Add
CONTAINERSexport for the list of box types that are containers
Changed
- Updated
README IsoBoxWritersignature now includes a requiredconfigparameter:(box: B, config: Required<IsoBoxWriteViewConfig>) => ArrayBufferViewwriteArraymethod now requires alengthparameter to specify the number of values to write- Renamed
IsoBoxReadableStreamConfigtoIsoBoxWriteViewConfig - Removed
writeVisualSampleEntryBoxexport (use specific visual sample entry writers likewriteAvc1,writeAvc3, etc. instead)
1.0.0-alpha.1 - 2025-12-27
Added
- Implement ISO Box writing (#269)
0.23.2 - 2025-12-26
Changed
- Update
@svta/cml-utilsto 1.1.0 (#279)
0.23.1 - 2025-12-22
Fixed
- Use fixed version numbers for all CML peer dependencies (#277)