Function: readStsc()
ts
function readStsc(cursor): SampleToChunkBox;Defined in: readers/readStsc.ts:23
Read the stsc box (SampleToChunkBox).
ISO/IEC 14496-12:2015 - 8.7.4
Parameters
cursor
The read cursor at the first byte after the box header
Returns
A parsed SampleToChunkBox
Example
ts
const isoFile = await readFile(new URL('../fixtures/captions.mp4', import.meta.url))
const boxes = readIsoBoxes(isoFile, {
readers: {
stsc: readStsc,
},
})
const stsc = findIsoBox(boxes, box => isIsoBoxType('stsc', box))
assert.ok(stsc)
assert.ok(isIsoBoxType('stsc', stsc))
assert.strictEqual(stsc.entries.length, 3)
assert.deepStrictEqual(stsc.entries[0], {
firstChunk: 1,
samplesPerChunk: 2,
sampleDescriptionIndex: 1,
})