mp4parser seems to be what you are looking for, although I'm not sure where exactly the rotation field is in MP4 (I don't know enough about the layout of the file). If you know in which field (or "atom") metadata is located, then MetaDataRead and MetaDataInsert are pretty clear examples of how to read and write data (they specifically work on the iTunes "Name" / "Title" field, but recording other metadata works the same when you know where it should be located). Hope this helps!
source
share