mp4 tag editing with java

限于喜欢 提交于 2021-01-27 15:56:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!