symbl-media

Convenience tools to convert your media

Usage no npm install needed!

<script type="module">
  import symblMedia from 'https://cdn.skypack.dev/symbl-media';
</script>

README

Symbl Media Utility

A simple set of media utilities.

Prerequistes

In order to use this utility you would need ffmpeg installed on your system. The simplest way to install ffmpeg on Mac OS X is Homebrew

brew install ffmpeg

Install

This utility can be used as a library in your NodeJS code. You can simply install it in your local project.

npm install symbl-media --save

If you don't want to use it in your code, you can install this utility as a CLI command.

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