JSPM

  • Created
  • Published
  • Downloads 949
  • Score
    100M100P100Q110756F
  • License MIT

A cross-platform npm distribution for HandbrakeCLI designed for command line or library use.

Package Exports

  • handbrake-js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (handbrake-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status handbrake-js

A cross-platform npm distribution for HandbrakeCLI designed for command line or library use.

As a library

Install

$ npm install handbrake-js

Usage

Handbrake-js has a single method: run. There are two ways to invoke it.

###handbrake.run(handbrakeOptions) Returns an EventEmitter enabling you to catch events as they happen.

var handbrake = require("handbrake-js");
    
var options = {
    input: "Eight Miles High.mov",
    output: "Eight Miles High.m4v",
    preset: "Normal"
};

handbrake.run(options)
    .on("output", console.log);
    .on("progress", function(encode){
        console.log(encode.percentComplete);
    })
    .on("complete", function(){ 
        console.log("Encode complete"); 
    });

handbrake.run(handbrakeOptions, onComplete)

The second method is to pass an onComplete callback. It's more convenient for short duration tasks: javascript handbrake.run({ preset-list: true }, function(stdout, stderr){ console.log(stdout); }); As a command line tool

Install

$ sudo npm install -g handbrake-js

Usage

Call handbrake-js as you would HandbrakeCLI, using all the usual options:

$ handbrake-js --input "Ballroom Bangra.avi" --output "Ballroom Bangra.mp4" --preset Normal

HandbrakeCLI installation

On Windows and Mac OSX installing handbrake-js automatically installs the correct HandbrakeCLI binary for your platform. Ubuntu users should additionally run:

$ sudo npm -g run-script handbrake-js ubuntu-setup

Documentation

For more detail on handbrake-js, see the API docs. For the full list of HandbrakeCLI options, see here.

Contributing

Fork the project then run:

$ git clone <your fork>
$ cd handbrake-js
$ npm link
$ <hack the code>
$ npm test