Modify Exif tags in Java for mp4 videos

廉价感情. 提交于 2021-01-28 08:47:19

问题


Is there any API or library in Java available that will let me modify tags in the metadata for mp4 files? I need to modify the orientation (or rotation) tag in order to get videos to playback in the correction orientation. Something for Android would be preferrable.


回答1:


Full disclosure: I'm the creator and maintainer of the mp4parser lib.

Use http://mp4parser.googlecode.com for opening the MP4 file. Navigate to the exif box (I have never seen that box) and modify it. Then write the file back to disk.

But are you really sure the exif box is changing the playback behavior? It rather seems to be an info box that tells you something about the recording situation.

I'd rather think you should modify the matrix in the Track Header Box (/moov/trak/tkhd) to retate the video. You might want to have a look a the Matrices part of the quicktime format specification (same as MP4 - at least for the matrices)

This answer here helps you with the matrix: https://stackoverflow.com/a/8177749/829133



来源:https://stackoverflow.com/questions/14621279/modify-exif-tags-in-java-for-mp4-videos

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