Giter Club home page Giter Club logo

node-ffprobe's Introduction

FFProbe for NodeJS

A simple wrapper around ffprobe written in NodeJS

This module requires ffmpeg to be installed before it can function. The ffmpeg package comes bundled with ffprobe.

Installation

sudo apt-get install ffmpeg
npm install node-ffprobe

Usage

var probe = require('node-ffprobe');

var track = '/path/to/media/file.mp3';

probe(track, function(err, probeData) {
	console.log(probeData);
});

Calling probe will execute ffprobe and parse the data it sends to STDOUT. A sample object can be seen below.

The streams, format, and metadata fields are taken directly from ffprobe. probe_time is the total execution time for the given file.

{
	"filename": "Before We Dissolve.mp3",
	"filepath": "/path/to/media",
	"fileext": ".mp3",
	"file": "/path/to/media/Before We Dissolve.mp3",
	"probe_time": 642,
	"streams": [
		{
			"codec_name": "mp3",
			"codec_long_name": "MP3 (MPEG audio layer 3)",
			"codec_type": "audio",
			"codec_time_base": "0/1",
			"codec_tag_string": "[0][0][0][0]",
			"codec_tag": "0x0000",
			"sample_rate": 44100,
			"channels": 2,
			"bits_per_sample": 0,
			"r_frame_rate": "0/0",
			"avg_frame_rate": "1225/32",
			"time_base": "1/14112000",
			"start_time": 0,
			"duration": 149.524898
		}
	],
	"format": {
		"nb_streams": 1,
		"format_name": "mp3",
		"format_long_name": "MPEG audio layer 2/3",
		"start_time": 0,
		"duration": 149.524898,
		"size": 2392815,
		"bit_rate": 128022
	},
	"metadata": {}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.