iso_base_media

pub package Build Status

A dart package to parse ISO Base Media File Format.

Usage

Extract hvcC boxes from an HEIC file

Future<void> main() async {
  final src = await FileRASource.openPath('./test/test_files/a.heic');
  final fileBox = ISOBox.createRootBox();
  final ipcoBox = await fileBox.getChildByTypePath(src, ['meta', 'iprp', 'ipco']);
  if (ipcoBox == null) {
    print('ipco box not found');
    return;
  }
  final hvcCBoxList = await ipcoBox.getDirectChildrenByTypes(src, {'hvcC'});
  if (hvcCBoxList.isEmpty) {
    print('hvcC box not found');
    return;
  }
  for (final hvcCBox in hvcCBoxList) {
    print('hvcC: start: ${hvcCBox.headerOffset}, size: ${hvcCBox.boxSize}');
  }
  /**
    * Output:
    hvcC: start: 253, size: 108
    hvcC: start: 381, size: 107
   */
}

Libraries

iso_base_media
A dart package to parse ISO Base Media File Format and MP4 files.