用java编辑mp4标签 [英] mp4 tag editing with java

查看:111
本文介绍了用java编辑mp4标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 java 中编辑 mp4 视频文件的标签.我在谷歌代码上找到了 mp4parser,但没有足够的文档.在 java 中编辑 mp4 视频标签的最佳库是什么?mp4视频中的评论标签有什么限制吗??

I want to edit tags of mp4 video file in java. I find out mp4parser on google code but there is no enough documentation for that. What would be the best lib for editing mp4 video tags in java. And is there any limitation for comment tag in mp4 video??

推荐答案

那么标签是指标题、艺术家、专辑等内容吗?在这种情况下,您可以尝试 JCodec 中提供的新 API (org.jcodec.movtool.MetadataEditor).它还有一个 CLI (org.jcodec.movtool.MetadataEditorMain).

So by tags you mean things like title, artist, album etc? In this case you can try the new API available in JCodec (org.jcodec.movtool.MetadataEditor). It also has a CLI (org.jcodec.movtool.MetadataEditorMain).

以下是基本用法:

# Changes the author of the movie
./metaedit -f -si ©ART=New\ value file.mov

或通过 Java API 做同样的事情:

or the same thing via the Java API:

MetadataEditor mediaMeta = MetadataEditor.createFrom(new
    File("file.mp4"));
Map<Integer, MetaValue> meta = mediaMeta.getItunesMeta();
meta.put(0xa9415254, MetaValue.createString("New value")); // fourcc for '©ART'
mediaMeta.save(false); // fast mode is off

您可以在此处找到完整的文档:http://jcodec.org/docs/working_with_mp4_metadata.html

You can find a complete documentation here: http://jcodec.org/docs/working_with_mp4_metadata.html

这篇关于用java编辑mp4标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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