var file = {}; file.mp4boxfile = null; file.objectToLoad = null; file.objectIsFile = false; file.fancytree = null; Log.setLogLevel(Log.debug); function createBoxView() { var treeboxes = getFancyTreeDataFromBoxes(file.mp4boxfile.boxes); file.fancytree.reload(treeboxes); var boxnodes = { title: 'file', children: treeboxes }; createBoxTreeMapSVG(boxnodes); createBoxPartition(boxnodes); } function resetBoxView() { file.fancytree.reload([]); d3.select('#boxmapview').html(''); d3.select('#boxpartitionview').html(''); } function finalizeAnalyzerUI(fileobj, loadbutton, success) { loadbutton.button('enable'); if (success) { createBoxView(); buildItemTable(fileobj.mp4boxfile.items); buildSampleView(); displayMovieInfo(fileobj.mp4boxfile.getInfo(), document.getElementById('movieview'), false); buildSegmentView(fileobj); buildEntityGroupTable(fileobj.mp4boxfile.entity_groups); } else { resetBoxView(); $('#itemview').html(''); resetSampleView(); $('#movieview').html(''); resetSegmentView(); $('#entitygroupview').html(''); } } function buildItemTable(items) { var html; var i, j; html = '
| ID | '; html += 'Name | '; html += 'Type | '; html += 'Primary | '; html += 'Protected | '; html += 'Byte ranges | '; html += 'References [type, item ID] | '; html += 'Properties [type] | '; html += '
|---|---|---|---|---|---|---|---|
| ' + item.id + ' | '; html += '' + (item.name ? item.name : '') + ' | '; html += '' + (item.type === 'mime' ? item.content_type : item.type) + ' | '; html += '' + (item.primary ? 'Yes' : 'No') + ' | '; html += '' + (item.protection ? item.protection : 'No') + ' | '; html += ''; for (j = 0; j < (item.extents ? item.extents.length : 0); j++) { html += '[' + item.extents[j].offset + '-' + (item.extents[j].offset + item.extents[j].length - 1) + '] '; } html += ' | '; html += ''; if (item.ref_to) { for (j = 0; j < item.ref_to.length; j++) { html += '[' + item.ref_to[j].type + ', ' + item.ref_to[j].id + '] '; } } html += ' | '; html += ''; if (item.properties) { for (j = 0; j < item.properties.boxes.length; j++) { html += '' + item.properties.boxes[j].type + ' '; } } html += ' | '; html += '
| " + properties[prop] + ' | '; } if (trak && trak.sample_groups_info) { //html += "Groups | "; for (j in trak.sample_groups_info) { sample_group_info = trak.sample_groups_info[j]; sample_group_name = sample_group_info.grouping_type.trim() + '/' + sample_group_info.grouping_type_parameter; html += "Sample Group '" + sample_group_name + "' | "; } } if (trak.mdia.minf.stbl.subs || trak.has_fragment_subsamples) { html += "subsamples | "; } html += '
|---|---|---|---|
| " + sample[properties[prop]]; if (properties[prop] == 'cts' || properties[prop] == 'dts') { html += ' - ' + Log.getDurationString(sample[properties[prop]], sample.timescale); } html += ' | '; } if (sample.sample_groups) { for (j in sample.sample_groups) { sample_group_info = sample.sample_groups[j]; if (sample_group_info) { sample_group_name = sample_group_info.grouping_type.trim() + '/' + sample_group_info.grouping_type_parameter; html += ""; if (sample_group_info.description) { html += generateBoxTable( sample_group_info.description, ['data', 'description_length', 'grouping_type'], undefined, true, ); } html += ' | '; } } } if (trak.mdia.minf.stbl.subs || trak.has_fragment_subsamples) { html += ""; if (sample.subsamples) { for (j = 0; j < sample.subsamples.length; j++) { html += generateBoxTable(sample.subsamples[j], [], [], true); } } html += ' | '; } html += '
| Segment Number | '; for (prop in segment) { html += '' + prop + ' | '; } html += '' + 'segment start' + ' | '; html += '' + 'segment offset' + ' | '; html += '' + 'tfdt baseMediaDecodeTime' + ' | '; html += '' + 'is encrypted' + ' | '; html += '
| ' + i + ' | '; for (prop in segment) { html += '' + segment[prop]; if (prop == 'subsegment_duration' || prop == 'SAP_delta_time') { html += ' - ' + Log.getDurationString(segment[prop], sidx.timescale); } html += ' | '; } html += '' + time + ' - ' + Log.getDurationString(time, sidx.timescale) + ' | '; while (j < boxes.length) { if (boxes[j].start === offset) { while (j < boxes.length) { if (boxes[j].type === 'moof') { moof = boxes[j]; break; } else { j++; } } break; } else { j++; } } html += '' + offset + ' | '; if (moof && moof.trafs && moof.trafs[0] && moof.trafs[0].tfdt) { var trak = isofile.getTrackById(moof.trafs[0].tfhd.track_id); var trak_timescale = trak.mdia.mdhd.timescale; html += '' + moof.trafs[0].tfdt.baseMediaDecodeTime + ' - ' + Log.getDurationString(moof.trafs[0].tfdt.baseMediaDecodeTime, trak_timescale) + ' | '; } if (moof && moof.trafs && moof.trafs[0]) { html += '' + (moof.trafs[0].senc ? true : false) + ' | '; } html += '
| Entity Group ID | '; html += 'Type | '; html += 'Entities [item ID] | '; html += 'Properties [type] | '; html += '' + entity_group.id + ' | '; html += '' + entity_group.type + ' | '; html += '' + entity_group.entity_ids.join() + ' | '; html += ''; if (entity_group.properties) { for (j = 0; j < entity_group.properties.boxes.length; j++) { html += '' + entity_group.properties.boxes[j].type + ' '; } } html += ' | '; html += ''; } html += ''; html += '
|---|