Giter VIP home page Giter VIP logo

media-conversion's Introduction

Media Conversion

Use this simple set of utilities for transcoding audio files either in NodeJS code, or as a CLI.

Setup

Prerequisites

Use of this utility requires ffmpeg installed on your system. If not already installed, download or if on Mac install with Homebrew

brew install ffmpeg

Install

For use as a library in your NodeJS code, run the following from inside your local project:

npm install symbl-media --save

For use as a CLI:

npm install -g symbl-media

To verify that it's installed properly, check with version command:

media version

Usage

Currently this utility only supports one feature:

  • Transcode Audio file

If using in CLI mode, to print the detailed usage of this utility you can run this command.

media --help

Transcode Audio File

You can simply transcode (convert) an audio file on your file system using this utility.

Command line

Use the transcode command to transcode the file.

media transcode -i ./my-input-file.wav -o ./my-output-file.mp3 -f mp3
Options
  `-i`, `--inFile`    file       Path to the Input File to be transcoded.                   
  `-o`, `--outFile`   file       Path to where the Output File should be saved.             
  `-f`, `--outFormat` format     Format of the output file. For example: mp3, wav, aac etc. 

Using Code

You can quickly transcode any audio/video file using transcodeMediaFile method.

const {transcodeMediaFile} = require('symbl-media');
(async () => {
    try {
        const result = await transcodeMediaFile('./my-input-file.wav', 'my-output-file.mp3', 'mp3');
        console.log('Successfully transcoded to: ', result.outPath);
    } catch (e) {
        console.error(e);
    }
})();

Also checkout the Examples folder for more examples

Community

If you have any questions, feel free to reach out to us at [email protected], through our Community Slack, or developer community

This guide is actively developed, and we love to hear from you! Please feel free to create an issue or open a pull request with your questions, comments, suggestions and feedback. If you liked our integration guide, please star our repo!

This library is released under the MIT License

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.