Skip to content

Library node.js to extract data from mediainfo output

License

Notifications You must be signed in to change notification settings

digason/node-mediainfos

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-mediainfos

Overview

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.

Usage

var mediainfo = require('node-mediainfos');

Mode with 2 parameters:

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

Mode with 3 parameters:

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

metadata

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.

Example

var mediainfo = require('node-mediainfos');
mediainfo([complete_path],'--Full',function (err,metadata) {
    if (err) {
        console.log(err);
    } else {
        console.log("%o", metadata);
    }
});

Promise Example

var mediainfo = require('node-mediainfos').es6;
mediainfo([complete_path],'--Full').then(function(metadata){
	console.log("%o", metadata);
}, function(err){
	console.log(err);
});

Contributors

Thank you to jgjake2 for adding promise.

Contact

email: philou2024

About

Library node.js to extract data from mediainfo output

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%