简体   繁体   English

使用MediaCodec API编辑MP4元数据

[英]Edit MP4 metadata using MediaCodec API

Android SDK provides class MediaMetadataRetriever for extracting metadata from MP4 files. Android SDK提供类MediaMetadataRetriever,用于从MP4文件中提取元数据。 Is there a way to edit MP4 metadata fields using MediaCodec API (without ffmpeg)? 有没有办法使用MediaCodec API(没有ffmpeg)编辑MP4元数据字段? My task is to reset rotation field. 我的任务是重置旋转字段。

mp4parser seems to be what you are looking for, although I'm not certain where exactly the rotation field is located in the MP4 (I don't know enough about the file layout). mp4parser似乎是你正在寻找的,虽然我不确定旋转字段在MP4中的确切位置(我对文件布局知之甚少)。 If you know which box (or "atom") the metadata is stored in, then the MetaDataRead and MetaDataInsert classes are pretty clear examples of how to read and write the data (they specifically work on the iTunes "Name"/"Title" field, but writing other metadata works the same way, once you know where it should be located). 如果您知道元数据存储在哪个框(或“原子”)中,则MetaDataReadMetaDataInsert类是如何读取和写入数据的非常明显的示例(它们专门用于iTunes“名称”/“标题”字段,但是一旦你知道它应该位于何处,写一些其他元数据就会以同样的方式工作。 Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM