mp3-to-video

1.0.3 • Public • Published

mp3-to-video

Create video from mp3 and a single image.

Install

npm i mp3-to-video --save

Prerequisites

You need to install ffmpeg.

Simple Usage

// ES6 
import ConvertCommand from 'mp3-to-video';
const Convert = new ConvertCommand('mp3Path', 'extension', 'imagePath');
Convert.init((err, response) => {
  if (err) { 
    console.log(err);
  } else {
    console.log(response.status);   // true
    console.log(response.message);  // Everything OK
    console.log(response.videoPath); // eg. /path/to/output.mp4
  }
});
 
// ES5
var ConvertCommand = require('mp3-to-video');
var Convert = new ConvertCommand('mp3Path', 'extension', 'imagePath');
Convert.init(function(err, response){
  if (err) { 
    console.log(err);
  } else {
    console.log(response.status);   // true
    console.log(response.message);  // Everything OK
    console.log(response.videoPath); // eg. /path/to/output.mp4
  }
});

API

  • changeMp3 : Change mp3 path.
  • changeOutput : Change output path.
  • changeExtension : Change extension output file.
  • changeImage : Change image path.

npm scripts

  • npm run build: It builds a development version of the mp3-to-video (full code).
  • npm run check-coverage: Check if exist library for code coverage.
  • npm run coverage: Run test with code coverage (un-tested statements, lines, functions or branches.).
  • npm run lint: It verify the code according to eslint rules.
  • npm run mocha: It run the test without code coverage.
  • npm run prepublish: It builds a development version before to publish in npm repository.
  • npm run test: Run script npm run coverage

Made with ❤ by

License

MIT license. Copyright © 2016.

Readme

Keywords

Package Sidebar

Install

npm i mp3-to-video

Weekly Downloads

0

Version

1.0.3

License

MIT

Last publish

Collaborators

  • slorenzo