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
- Host: GitHub
- URL: https://github.com/omarassadi/matroska-tika
- Owner: OmarAssadi
- License: apache-2.0
- Created: 2021-09-19T10:19:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-19T10:20:47.000Z (over 3 years ago)
- Last Synced: 2025-03-27T10:48:28.260Z (3 months ago)
- Topics: apache-tika, ebml, java, matroska, mime-types, mkv, multimedia, tika, tika-parsers, webm
- Language: Java
- Homepage:
- Size: 66.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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());
```