Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mp4 tag editing with java

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??

like image 483
canromero Avatar asked Oct 24 '25 05:10

canromero


1 Answers

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

like image 132
Stanislav Vitvitskyy Avatar answered Oct 26 '25 20:10

Stanislav Vitvitskyy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!