java - How can I extract meta data from various video file formats? -
how can extract meta data various video file formats, resolution , type of codec used. (but other stuff author). not able find library that.
i have found mediainfo, supplies dozens of technical , tag information video or audio file.
there jni wrapper mediainfo in subs4me's source tree find useful.
here code snippets show how extract information media file:
file file = new file("path/to/my/file"); mediainfo info = new mediainfo(); info.open(file); string format = info.get(mediainfo.streamkind.video, i, "format", mediainfo.infokind.text, mediainfo.infokind.name); int bitrate = info.get(mediainfo.streamkind.video, i, "bitrate", mediainfo.infokind.text, mediainfo.infokind.name); float framerate = info.get(mediainfo.streamkind.video, i, "framerate", mediainfo.infokind.text, mediainfo.infokind.name); short width = info.get(mediainfo.streamkind.video, i, "width", mediainfo.infokind.text, mediainfo.infokind.name); int audiobitrate = info.get(mediainfo.streamkind.audio, i, "bitrate", mediainfo.infokind.text, mediainfo.infokind.name); int audiochannels = info.get(mediainfo.streamkind.audio, i, "channels", mediainfo.infokind.text, mediainfo.infokind.name);
Comments
Post a Comment