public static MetadataEditor createFrom(File f) throws IOException {
Format format = JCodecUtil.detectFormat(f);
if (format != Format.MOV) {
throw new IllegalArgumentException("Unsupported format: " + format);
}
Movie movie = MP4Util.parseFullMovie(f);
MetaBox keyedMeta = NodeBox.findFirst(movie.getMoov(), MetaBox.class, MetaBox.fourcc());
MetaBox itunesMeta = NodeBox.findFirstPath(movie.getMoov(), MetaBox.class,
new String[] { "udta", MetaBox.fourcc() });
return new MetadataEditor(f, keyedMeta == null ? new HashMap<String, MetaValue>() : keyedMeta.getKeyedMeta(),
itunesMeta == null ? new HashMap<Integer, MetaValue>() : itunesMeta.getItunesMeta());
}