问题
I want to edit tags of mp4 video file in java. I find out mp4parser on google code but there is no enough documentation for that. What would be the best lib for editing mp4 video tags in java. And is there any limitation for comment tag in mp4 video??
回答1:
So by tags you mean things like title, artist, album etc? In this case you can try the new API available in JCodec (org.jcodec.movtool.MetadataEditor). It also has a CLI (org.jcodec.movtool.MetadataEditorMain).
Here's the basic usage:
# Changes the author of the movie
./metaedit -f -si ©ART=New\ value file.mov
or the same thing via the Java API:
MetadataEditor mediaMeta = MetadataEditor.createFrom(new
File("file.mp4"));
Map<Integer, MetaValue> meta = mediaMeta.getItunesMeta();
meta.put(0xa9415254, MetaValue.createString("New value")); // fourcc for '©ART'
mediaMeta.save(false); // fast mode is off
You can find a complete documentation here: http://jcodec.org/docs/working_with_mp4_metadata.html
来源:https://stackoverflow.com/questions/13360501/mp4-tag-editing-with-java