Closed ValentineKh closed 7 years ago
I've figured out. In class DefaultMp4Builder I found this: /**
null
if none provided
/
protected Box createUdta(Movie movie) {
return null;
}
If we need to add user metadata we should add it in createUdta method.
If we need to override some other information (not userMetaData) we should add freeBox in userMetadata to have additional space.
For example.
private class MyMp4Builder extends DefaultMp4Builder {
@Override
protected Box createUdta(Movie movie) {
UserDataBox userDataBox = new UserDataBox();
MetaBox metaBox = new MetaBox();
HandlerBox hdlr = new HandlerBox();
hdlr.setHandlerType("mdir");
metaBox.addBox(hdlr);
userDataBox.addBox(metaBox);
FreeBox freeBox = new FreeBox(128 1024);
metaBox.addBox(freeBox);
return userDataBox;
}
}
Hello. I need to add custom metaData to file during creation. I've used com/googlecode/mp4parser/ShortenExample.java and org/mp4parser/examples/metadata/MetaDataInsert.java. But this solution reopens the file several times and requires twice bigger space in the storage.
Could you please suggest me some ideas how to add metadata during file creation. Or how to add FreeBox to the file while trimming?
Thanks.