// TODO Decide how to handle multiple tracks
List<TrackBox> tb = moov.getBoxes(TrackBox.class);
if (tb.size() > 0) {
TrackBox track = tb.get(0);
TrackHeaderBox header = track.getTrackHeaderBox();
// Get the creation and modification dates
metadata.set(
TikaCoreProperties.CREATED,
MP4TimeToDate(header.getCreationTime())
);
metadata.set(
TikaCoreProperties.MODIFIED,
MP4TimeToDate(header.getModificationTime())
);
// Get the video with and height
metadata.set(Metadata.IMAGE_WIDTH, (int)header.getWidth());
metadata.set(Metadata.IMAGE_LENGTH, (int)header.getHeight());
// Get the sample information
SampleTableBox samples = track.getSampleTableBox();
SampleDescriptionBox sampleDesc = samples.getSampleDescriptionBox();
if (sampleDesc != null) {