Skip to content

Simple media utility for audio operations like audio transcoding.

Notifications You must be signed in to change notification settings

symblai/media-conversion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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