Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.
/ MediaInfo4J Public archive

A simple Java library for reading MediaInfo from media files.

License

Notifications You must be signed in to change notification settings

oppahansi/MediaInfo4J

Repository files navigation

GitHub build GitHub GitHub issues GitHub pull requests GitHub last commit

GitHub last commit

MediaInfo4J

A Java library for parsing media information using the MediaInfo library.
This library provides a simple interface to extract metadata from media files.

Installing

Gradle

implementation group: 'io.github.oppahansi', name: 'MediaInfo4J', version: '0.2.1'

Maven

<dependency>
    <groupId>io.github.oppahansi</groupId>
    <artifactId>MediaInfo4J</artifactId>
    <version>0.2.1</version>
</dependency>

Usage

From a file path

MediaInfoParser parser = new MediaInfoParser()
MediaInfo mediaInfo = parser.parseFile(filePath);

// Print all sections and their fields
mediaInfo.print();

or

MediaInfo mediaInfo = MediaInfo.fromFile(filePath);

// Print all sections and their fields
mediaInfo.print();

From a string

MediaInfoParser parser = new MediaInfoParser()
MediaInfo mediaInfo = parser.parseData(dataString);

// Print all sections and their fields
mediaInfo.print();

or

MediaInfo mediaInfo = MediaInfo.fromData(dataString);

// Print all sections and their fields
mediaInfo.print();

Features

  • Parsing of media information from files using the MediaInfo native library.
  • Extraction of metadata such as format, duration, codec, chapters, and more from media files.
  • Simple Java API to access sections and fields of parsed media info.
  • Support for reading media info from both file paths and raw data strings.
  • Better parsing, than in vlcj-info:
    • Support for Chapter fields and values
  • More methods for checking the validity for files:
    • CRC32
    • Adler32
    • MD5
    • SHA1
    • SHA256
    • SHA512
  • New Menu fields for better chapter parsing:
    • ChapterCount (Total number of chapters)
    • ChapterName x (ChapterName 1 -> : en:Time for Ignition...)
    • ChapterTimestamp x (ChapterTimestamp 1 -> 00:00:00.000...)

Acknowledgments

This project was inspired by and partially derived from the vlcj-info library.
And therefore code is being made public and released under the same license.

About

A simple Java library for reading MediaInfo from media files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages