An open API service indexing awesome lists of open source software.

https://github.com/omarassadi/matroska-tika

Tika detector for MKV and WebM
https://github.com/omarassadi/matroska-tika

apache-tika ebml java matroska mime-types mkv multimedia tika tika-parsers webm

Last synced: 3 months ago
JSON representation

Tika detector for MKV and WebM

Awesome Lists containing this project

README

        

# Matroska Tika

This project adds a Tika detector for MKV and WebM files, allowing you to determine the correct MIME type based on the
file contents.

## Usage

1. Add Apache Tika as a dependency:

```groovy
implementation 'org.apache.tika:tika-core'
```

2. Add the Matroska Tika as a dependency. I intend on publishing this to the central repository soon.

3. Either use the Matroska detector directly:

```java
final MatroskaDetector detector=new MatroskaDetector();
final InputStream mkv=new BufferedInputStream(new FileInputStream("test.mkv"));
final MediaType type=detector.detect(mkv,new Metadata());
```

or use Tika's composite detector:

```java
final TikaConfig tika=new TikaConfig();
final Detector detector=tika.getDetector();
final InputStream mkv=new BufferedInputStream(new FileInputStream("test.mkv"));
final MediaType type=detector.detect(mkv,new Metadata());
```