npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mediaanalyser

v0.1.5

Published

Permet l'analyse de media en utilisant ''mediaInfo'' et ''ffmpeg''.

Downloads

46

Readme

mediaanalyser

Overview

Petit module en node.js permettant d'utiliser les données de mediainfo et ffmpeg pour les sortir sous le format d'un json.

Testé sous Windows mais devrait fonctionner sous Linux avec les bonnes version de soft.

ATTENTION : Les deux softs doivent être présent dans votre système et référencé dans votre $path pour une utilisation plus simple de la config mediaInfo : https://sourceforge.net/projects/mediainfo/ ffmpeg : https://ffmpeg.org/

Utilisation

Mode with 4 parameters:

extractRaw => permet d'extraire sous forme de fichier les réponses brut de mediaInfo et ffprobe path_mediaInfo => chemin de mediaInfo (si déclaré dans $PATH laisser vide) path_ffmpeg => chemin de ffprobe (si déclaré dans $PATH laisser vide) [fileNameMedia] => chemin + nom de fichier du média à analyser

Exemple

var media_analyser = require("mediaanalyser");

var config = {
    extractRaw: false,      // permet d'extraire sous forme de fichier les réponses brut de mediaInfo et ffprobe
    path_mediaInfo: '',     // chemin de mediaInfo (si déclaré dans $PATH laisser vide)
    path_ffmpeg: ''         // chemin de ffprobe (si déclaré dans $PATH laisser vide)
};

var analyser = new media_analyser(config);

var fileName = "C:\\tmp\\mon_media.mov";

// Version compilé mediaInfo + ffprobe (version json)
analyser.run(fileName).then(function (responseJson)
{
    console.log('Analyse media "' + fileName + '" : ', responseJson);
}, function (err)
{
    console.error('Analyse media "' + fileName + '" ERROR : ', err);
});

// Réponse brut mediaInfo (version XML sans les __ par défaut exposé)
analyser.mediaInfo(fileName).then(function (responseXml)
{
    console.log('Analyse mediaInfo "' + fileName + '" : ', responseXml);
}, function (err)
{
    console.error('Analyse mediaInfo "' + fileName + '" ERROR : ', err);
});

// Réponse brut ffprobe (version json)
analyser.ffprobe(fileName).then(function (responseJson)
{
    console.log('Analyse ffprobe "' + fileName + '" : ', responseJson);
}, function (err)
{
    console.error('Analyse ffprobe "' + fileName + '" ERROR : ', err);
});

Version

0.0.9: Version béta fonctionnelle 0.1.0: Ajout de la possibilité des sortir les données brut des lib 0.1.0: Ajout de la possibilité des sortir les données brut des lib 0.1.1: Correction bug sur les données brut des lib 0.1.2: Suppression des __ par défaut dans les balises XML de mediaInfo 0.1.3: Correction de l'expréssion pour le remplacement des __ dans les balises XML de mediaInfo 0.1.4: bis 0.1.5: Correction sur les données de sortie pour ffprobe pour les avoirs en JSON avant en STRING au lieu d'etre OBJECT

Contact

email: casimodo

Exemple de sortie

Analyse media "C:\tmp\mon_media.mov" :  { general: 
   [ { Format: 'QuickTime',
       Format_Info: 'Original Apple specifications',
       File_size: '72.1 GiB',
       Duration: '2h 9mn',
       Overall_bit_rate: '79.6 Mbps',
       Encoded_date: 'UTC 2016-04-05 10:12:53' } ],
  videos: 
   [ { ID: '1',
       streamid: '1',
       Format: 'MPEG Video',
       Codec_ID: 'xd5c',
       Duration_hours: '2h 9mn',
       Bit_rate: '50.0 Mbps',
       Bit_rate_mode: '',
       Width: 1920,
       Height: 1080,
       Display_aspect_ratio: '16:9',
       sample_aspect_ratio: '',
       Frame_rate: '25.000 fps',
       Frame_rate_mode: 'Constant',
       Color_space: 'YUV',
       Compression_mode: 'Lossy',
       BitsPixel_Frame: '0.965',
       Stream_size: '45.3 GiB (63%)',
       Language: 'English',
       Encoded_date: 'UTC 2016-04-05 10:57:54',
       Tagged_date: 'UTC 2016-04-05 10:57:54',
       codec_name: 'mpeg2video',
       codec_tag: '0x63356478',
       codec_long_name: 'MPEG-2 video',
       profile: '4:2:2',
       codec_time_base: '1/50',
       pix_fmt: 'yuv422p',
       level: 2,
       color_range: 'tv',
       chroma_location: 'left',
       timecode: '00:00:00:00',
       refs: 1,
       r_frame_rate: '25/1',
       avg_frame_rate: '25/1',
       time_base: '1/600',
       duration_ts: 4664256,
       duration: '7773.760000',
       bit_rate: '50005651',
       max_bit_rate: '50000000',
       nb_frames: '194344' },
     { ID: '6',
       streamid: '2',
       Format: 'Ovbi',
       Codec_ID: 'Ovbi',
       Duration_hours: '2h 9mn',
       Bit_rate: '290 Kbps',
       Bit_rate_mode: 'Constant',
       Width: '',
       Height: '',
       Display_aspect_ratio: '',
       sample_aspect_ratio: '',
       Frame_rate: '25.000 fps',
       Frame_rate_mode: 'Constant',
       Color_space: '',
       Compression_mode: '',
       BitsPixel_Frame: '',
       Stream_size: '269 MiB (0%)',
       Language: 'English',
       Encoded_date: 'UTC 2016-04-05 10:57:54',
       Tagged_date: 'UTC 2016-04-05 10:57:54',
       codec_name: '',
       codec_tag: '',
       codec_long_name: '',
       profile: '',
       codec_time_base: '',
       pix_fmt: '',
       level: '',
       color_range: '',
       chroma_location: '',
       timecode: '',
       refs: '',
       r_frame_rate: '',
       avg_frame_rate: '',
       time_base: '',
       duration_ts: '',
       duration: '',
       bit_rate: '',
       max_bit_rate: '',
       nb_frames: '' } ],
  audios: 
   [ { ID: '2',
       streamid: '1',
       Format: 'PCM',
       Format_settingsEndianness: 'Little',
       Format_settingsSign: 'Unsigned',
       Codec_ID: 'in24',
       Duration: '2h 9mn',
       Bit_rate_mode: 'Constant',
       Bit_rate: '2 304 Kbps',
       Channel_s: '2 channels',
       Sampling_rate: '48.0 KHz',
       Bit_depth: '24 bits',
       Stream_size: '2.09 GiB (3%)',
       Language: 'English',
       Encoded_date: 'UTC 2016-04-05 10:57:54',
       Tagged_date: 'UTC 2016-04-05 10:57:54',
       codec_name: 'pcm_s24le',
       codec_long_name: 'PCM signed 24-bit little-endian',
       codec_time_base: '1/48000',
       codec_tag_string: 'in24',
       codec_tag: '0x34326e69',
       sample_fmt: 's32',
       sample_rate: '48000',
       channels: 2,
       bits_per_sample: 24 },
     { ID: '3',
       streamid: '2',
       Format: 'PCM',
       Format_settingsEndianness: 'Little',
       Format_settingsSign: 'Unsigned',
       Codec_ID: 'in24',
       Duration: '2h 9mn',
       Bit_rate_mode: 'Constant',
       Bit_rate: '2 304 Kbps',
       Channel_s: '2 channels',
       Sampling_rate: '48.0 KHz',
       Bit_depth: '24 bits',
       Stream_size: '2.09 GiB (3%)',
       Language: 'English',
       Encoded_date: 'UTC 2016-04-05 10:57:54',
       Tagged_date: 'UTC 2016-04-05 10:57:54',
       codec_name: 'pcm_s24le',
       codec_long_name: 'PCM signed 24-bit little-endian',
       codec_time_base: '1/48000',
       codec_tag_string: 'in24',
       codec_tag: '0x34326e69',
       sample_fmt: 's32',
       sample_rate: '48000',
       channels: 2,
       bits_per_sample: 24 },
     { ID: '4',
       streamid: '3',
       Format: 'PCM',
       Format_settingsEndianness: 'Little',
       Format_settingsSign: 'Unsigned',
       Codec_ID: 'in24',
       Duration: '2h 9mn',
       Bit_rate_mode: 'Constant',
       Bit_rate: '2 304 Kbps',
       Channel_s: '2 channels',
       Sampling_rate: '48.0 KHz',
       Bit_depth: '24 bits',
       Stream_size: '2.09 GiB (3%)',
       Language: 'English',
       Encoded_date: 'UTC 2016-04-05 10:57:54',
       Tagged_date: 'UTC 2016-04-05 10:57:54',
       codec_name: 'pcm_s24le',
       codec_long_name: 'PCM signed 24-bit little-endian',
       codec_time_base: '1/48000',
       codec_tag_string: 'in24',
       codec_tag: '0x34326e69',
       sample_fmt: 's32',
       sample_rate: '48000',
       channels: 2,
       bits_per_sample: 24 },
     { ID: '5',
       streamid: '4',
       Format: 'PCM',
       Format_settingsEndianness: 'Little',
       Format_settingsSign: 'Unsigned',
       Codec_ID: 'in24',
       Duration: '2h 9mn',
       Bit_rate_mode: 'Constant',
       Bit_rate: '2 304 Kbps',
       Channel_s: '2 channels',
       Sampling_rate: '48.0 KHz',
       Bit_depth: '24 bits',
       Stream_size: '2.09 GiB (3%)',
       Language: 'English',
       Encoded_date: 'UTC 2016-04-05 10:57:54',
       Tagged_date: 'UTC 2016-04-05 10:57:54',
       codec_name: 'pcm_s24le',
       codec_long_name: 'PCM signed 24-bit little-endian',
       codec_time_base: '1/48000',
       codec_tag_string: 'in24',
       codec_tag: '0x34326e69',
       sample_fmt: 's32',
       sample_rate: '48000',
       channels: 2,
       bits_per_sample: 24 } ] }