diff --git a/.gitignore b/.gitignore index 211662d..1043866 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ node_modules /dist /dist-docs .DS_Store -.vitepress/cache +docs/.vitepress/cache /docs/api *.tsbuildinfo diff --git a/dev/demux.html b/dev/demux.html index 3afb290..5354400 100644 --- a/dev/demux.html +++ b/dev/demux.html @@ -18,7 +18,7 @@ }); const track = await input.getPrimaryVideoTrack(); - console.log(await track.computeFrameRateMetrics()); + console.log(await track.getDecoderConfig()); /* diff --git a/src/isobmff/isobmff-demuxer.ts b/src/isobmff/isobmff-demuxer.ts index 866d6b3..814dc8e 100644 --- a/src/isobmff/isobmff-demuxer.ts +++ b/src/isobmff/isobmff-demuxer.ts @@ -1387,23 +1387,31 @@ export class IsobmffDemuxer extends Demuxer { case 'avcC': { const track = this.currentTrack; - if (!track || boxInfo.contentSize === 0) { - // FFmpeg will sometimes generate an empty avcC chunk if provided no headers + if (!track) { break; } assert(track.info); + if (boxInfo.contentSize === 0) { + // avcC box is empty, let's treat this like an Annex B stream + break; + } + track.info.codecDescription = readBytes(slice, boxInfo.contentSize); }; break; case 'hvcC': { const track = this.currentTrack; - if (!track || boxInfo.contentSize === 0) { - // FFmpeg will sometimes generate an empty hvcC chunk if provided no headers + if (!track) { break; } assert(track.info); + if (boxInfo.contentSize === 0) { + // hvcC box is empty, let's treat this like an Annex B stream + break; + } + track.info.codecDescription = readBytes(slice, boxInfo.contentSize); }; break;