Library node.js to extract data from mediainfo output, in simple ou Full mode.
WARNING : It doesn't work with XML issues.
Library was written to access metadata issued by mediainfo.
It works on Linux (Ubuntu, CentOS), and Windows.
var mediainfo = require('node-mediainfos');
mediainfo([complete_path],callback)
-
parameter 1
Full path to file to analyze. It takes only one file.
-
parameter 3
The callback function is called with 2 parameters:
err: return true or false
metadata: return hash of data
mediainfo([complete_path],'--Full',callback)
-
parameter 1
Full path to file to analyze. It takes only one file.
-
parameter 2
--Full
-
parameter 3
The callback function is called with 2 parameters:
err: returns error from mediainfo.
metadatr: returns hash of data
The second parameter of callback contains issue from mediainfo in a javascript object.
The keys of level 1 come from mediainfo issue.
Regular keys:
- general
- video
- audio
Other keys
- text
- menu
Depends from data found by mediainfo.
For each key, data are set in an array.
var mediainfo = require('node-mediainfos');
mediainfo([complete_path],'--Full',function (err,metadata) {
if (err) {
console.log(err);
} else {
console.log("%o", metadata);
}
});
var mediainfo = require('node-mediainfos').es6;
mediainfo([complete_path],'--Full').then(function(metadata){
console.log("%o", metadata);
}, function(err){
console.log(err);
});
email: philou2024