How can I extract meta data from various video file formats?
-
How can I extract meta data from various video file formats, especially the Resolution and the type of codec used. (But also all other stuff like author). I was not able to find a library for that.
-
Answer:
I have found MediaInfo (http://mediainfo.sourceforge.net/) which supplies dozens of technical and tag information about a video or audio file. There is a JNI wrapper for MediaInfo in http://code.google.com/p/subs4me/ http://code.google.com/p/subs4me/source/browse/trunk/Subs4me/src/net/sourceforge/filebot/mediainfo/?r=93 that I find very useful. Here are some code snippets that show how to extract some information from a media file: String fileName = "path/to/my/file"; File file = new File(fileName); 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);
jens at Stack Overflow Visit the source
Other answers
jens
Related Q & A:
- How can I insert posted data into the database?Best solution by Stack Overflow
- How can I query Parse data by creation date with Swift?Best solution by Stack Overflow
- How can I add the data to shopping cart?Best solution by Stack Overflow
- How can I sort my data in alphabetic order?Best solution by Stack Overflow
- How can I extract data of an external XML to PHP?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.