How do you edit MP4 ID3 tags in Java?

I asked a similar question a while ago, but with python, and since then decided to switch to Java, because there seemed to be more resources for this kind of thing. Basically, I need some kind of library, idea or instructions that will allow me to edit ID3 tags in an MP4 file, such as the view found in iTunes. If anyone knows anything, your help would be greatly appreciated.

So far I have done the following:

  • I found this question / answer to a very similar problem: How do you edit Video ID3v2 tags in Java (it describes how to use a library designed for audio files called JID3 to edit ID3 video videos), but I can’t understand how real I import it into an eclipse project and use it. I basically unpacked it and added all the packages to the project, but once it worked, it made the movie file unreadable for any media player afterwards. If anyone has specific knowledge on how to import and use JID3, that would be great.

  • I found this site: http://willcode4beer.com/parsing.jsp?set=mp3ID3 , which apparently has good code for reading and writing ID3 tags, unfortunately it does not work properly, constantly returns question lines characters or tells me that the file does not exist spontaneously (it will literally work once and then not work at other times without any changes). However, I like the idea of ​​just reading bytes or an ASCII file and finding / editing the ID3 tag this way, so if someone knows what to do for this, that would be awesome.

Thanks in advance.

+3
source share
2 answers

MP4 ID3. ID3, . ID3 /moov/meta/id 32. iTunes /moov/udta/... "@cmt", "@nam", "@des", "@cpy", ( ) , , , . http://code.google.com/p/mp4parser/ , MP4.

+1

, , : , , .., iTunes QuickTime.

API, JCodec (org.jcodec.movtool.MetadataEditor).   CLI (org.jcodec.movtool.MetadataEditorMain).

:

# Changes the author of the movie
./metaedit -f -si ©ART=New\ value file.mov

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

: http://jcodec.org/docs/working_with_mp4_metadata.html

0

All Articles