在Java中修改mp4视频的Exif标签 [英] Modify Exif tags in Java for mp4 videos

查看:67
本文介绍了在Java中修改mp4视频的Exif标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java中是否有可用的API或库可让我修改mp4文件的元数据中的标记?我需要修改方向(或旋转)标签,以使视频以校正方向播放.最好使用Android版.

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.

推荐答案

完全公开:我是mp4parser lib的创建者和维护者.

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

使用 http://mp4parser.googlecode.com 打开MP4文件.导航到exif框(我从未见过该框)并对其进行修改.然后将文件写回到磁盘.

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.

但是您真的确定exif框正在改变播放行为吗?它似乎是一个信息框,它告诉您有关录制情况的信息.

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.

我宁愿您应该修改Track Header Box(/moov/trak/tkhd)中的矩阵以重新播放视频.您可能想看看

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)

这里的答案可以帮助您了解矩阵: https://stackoverflow.com/a/8177749/829133

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

这篇关于在Java中修改mp4视频的Exif标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆