我有一组 mp4 文件,需要加载到 SD 卡上并在 Android 应用程序中读取。
该应用需要能够按类别搜索视频,因此我的计划是在加载它们之前在 mp4 元数据中添加一些类别信息(可能在“描述”字段中),然后使用 ManagedQuery
在 MediaStore.Video.Media.EXTERNAL_CONTENT_URI
上找到它们。
我已使用 Adobe Bridge 更新了“描述”字段,但是当我查看搜索返回的标签时,“描述”字段始终为空。显然,当 Android 查看视频文件时,我写入 mp4 文件的数据没有被拾取。
我还有其他方法可以编写/搜索视频元数据吗?
I have a set of mp4 files that I need to load onto an SD Card and read in my Android app.
The app needs to be able to search the videos by category, so my plan was to add some category info in the mp4 metadata before loading them (probably in the "description" field) and then use a ManagedQuery
on the MediaStore.Video.Media.EXTERNAL_CONTENT_URI
to find them.
I have updated the "description" field using Adobe Bridge, but when I look at the tags returned by a search, the "description" field is always null. Clearly, the data I'm writing to the mp4 files is not being picked up when Android looks at the video file.
Is there another way I should be writing/searching video metadata?
发布评论
评论(2)
您可能应该查看
MediaStore.Video.VideoColumns .描述
。您可以像查询任何其他内容提供商一样查询
MediaStore.Video.Media.EXTERNAL_CONTENT_URI
:http://developer.android.com/guide/topics/providers/content-providers.html#queryingYou should probably look at
MediaStore.Video.VideoColumns.DESCRIPTION
.You can query the
MediaStore.Video.Media.EXTERNAL_CONTENT_URI
as you would any other content provider: http://developer.android.com/guide/topics/providers/content-providers.html#querying您可以使用 JCodec 的 MetadataEditor 类。
如果要将元数据字段添加到 MP4 文件,您可以使用:
或者可以使用 CLI 工具从命令行完成相同的操作 (MetadataEditorMain):
在 Java 代码中,您可以像这样获取元数据列表:
或者命令行:
了解更多信息:http://jcodec.org/docs/working_with_mp4_metadata.html
You can add/delete/lookup metadata fields in MP4 files using JCodec's MetadataEditor class.
If you want to add metadata field to MP4 file you can use:
Alternatively the same can be done from the command line with the CLI tool (MetadataEditorMain):
In the Java code you can get the list of metadata like so:
OR from the command line:
Read more about it: http://jcodec.org/docs/working_with_mp4_metadata.html