Javascript MKV Parser: JavaSParse and extract informationcript MKV Parser

Recommend this page to a friend!
  Info   View files Documentation   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-10-28 (Yesterday) RSS 2.0 feedNot enough user ratingsTotal: 67 This week: 1All time: 477 This week: 3Up
Version License JavaScript version Categories
mkvinfo 1.0.2Custom (specified...5Audio, Video, Parsers


This object can parse and extract information from MKV video files.

It can take the URL or selected file of a MKV video and read it to parse its information.

The object takes a callback function to handle errors, or if it succeed it calls another callback function passing the parse information in easy to process data structure.

It returns information about the audio and video streams like the format, compatibility, indexation, duration, bitrate, creator, codecs, size, samples, language, frame rate, width height, etc..

Innovation Award
JavaScript Programming Innovation award nominee
April 2016
Number 5
Many sites need to take videos uploaded by the users. When a user uploads a video he may not be certain if that is the right video that he wants to upload and may only realize that after a few hours when the video finishes uploading.

This object is one of several others that can help addressing this issue by being able to parse and extract data from an MP4 video even before the user uploads it. This way the user can confirm if the video was the right was that he wanted to upload.

Other versions of this package exist for parsing MP4 and AVI video files.

Manuel Lemos
Picture of Dantigny francois
  Performance   Level  
Name: Dantigny francois <contact>
Classes: 5 packages by
Country: France France
Age: ???
All time rank: 1307 in France France
Week rank: 2 Up1 in France France Up
Innovation award
Innovation award
Nominee: 5x



Sort of "Mediainfo" for MKV / WebM Files - little MKVParser (just for main technics information about the file)

Dependances : null

Usage :

<script src="MKVInfo.js" type="text/javascript" charset="utf-8"></script> 
(in single file .html)

(in worker)

How use it :

        mkv(this.files[0], function(err, info) {
            if (err) {
            } else {
                sortie_texte = human_reading(info);

MKVInfo return an object structured (named 'info') wich contains a lot of technicals information about the file. If we want to read this informations, we need to make them readable. So human_reading is here !

Examples :

for a single file and no worker : index.html
for multiple files and worker   : indexw.html

Optimisations ?

Oh Yesssss ! MKVInfo does not calculate the size of each stream because it's too heavy (too slow !). 
The main optimisation to do is to use a buffer (in this version MKVInfo use a little buffer of 20 bytes length !)

Try it ?   (multiple + worker + use MKVInfo.min.js)    

Troubles with Firefox or Internet Explorer ?

Try index.html ! (indexw.html is good with Chrome ^_^ )   
WHY ? Because Firefox don't recognize Matroska files (or Webm file) as mime-type = 'video/x-matroska' or 'video/webm' but as mime-type = 'application/force-download' !

Evolutions :

In order to deal with "callbacks hell", I used async/await for clearing code (no more stack troubles :-)
Now, for multiple files, workers do the job with some kind of "parallelism" : gain half time !
  Files folder image Files  
File Role Description
Accessible without login Plain text file ebml.db.sql Example Example script
Accessible without login HTML file index.html Doc. Example without worker
Accessible without login HTML file indexw.html Doc. Example with worker
Accessible without login Plain text file LICENSE Lic. License
Accessible without login Plain text file MKVInfo.js Aux. Main class
Accessible without login Plain text file MKVInfo.min.js Aux. Main class (minified)
Accessible without login Plain text file Doc. Documentation
Accessible without login Plain text file workerMKV.js Aux. Worker

 Version Control Unique User Downloads Download Rankings  
This week:1
All time:477
This week:3Up