是否有用于提取MP4元数据的JAVA API [英] Is there a JAVA API for extract MP4 Metadata

查看:680
本文介绍了是否有用于提取MP4元数据的JAVA API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想具体说明我的要求。我不是要求修改任何MP4文件,只是提取宽度和高度以及比特率和编码等元数据,这不在MP3标签中。

I want to be specific as to what I am asking. I am not asking to modified any MP4 files, just extract metadata such as Width and Height and bitrate and encoding and this is not in the MP3 tags.

我测试了Xuggle哪个有效,但我需要一个不使用JNI或任何本机代码的库。

I have tested Xuggle which works, but I need to have a library that does not use JNI or any native code.

我已经查看过MP4Parser和Apache Tika,但他们都没有提取元数据,只标记信息或更改文件。

I already looked into MP4Parser, and Apache Tika, and they both does not extract metadata, just tag info or alter the file.

是否有这样的java lib?

Is there such java lib?

推荐答案

我实际上使用 Mp4Parser 找到了我想要的东西

I actually found what I was looking for using Mp4Parser

这里是一个简单的代码行,可以使用Mp4Parser得到我想要的东西

here is a simple lines of code to get what I wanted using Mp4Parser

FileChannel fc = new FileInputStream("content/Video_720p_Madagascar-3.mp4").getChannel();
IsoFile isoFile = new IsoFile(fc);
MovieBox moov = isoFile.getMovieBox();
for(Box b : moov.getBoxes()) {
    System.out.println(b);
}

b包含我需要的所有信息,现在我只需解析b到得到我想要的。

b contains all the info I needed, now I just have to parse b to get exactly what I want.

这篇关于是否有用于提取MP4元数据的JAVA API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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