mini-ffmpeg
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Simple FFmpeg Wrapper

Installing

Npm:

npm i mini-ffmpeg@latest

Yarn:

yarn add mini-ffmpeg@latest

Example Usage

Example 1:

// TypeScript
// import FFmpeg from "mini-ffmpeg"
const FFmpeg = require("mini-ffmpeg").default;

new FFmpeg()
        .inputs("./audio.mp3")
        // (option, param)
        .options("-acodec", "flac")
        .output("./audio.flac")
        .execute()
        .then(() => console.log("Ok"))
        .catch(console.log);

Example 2:

// TypeScript
// import FFmpeg from "mini-ffmpeg"
const FFmpeg = require("mini-ffmpeg").default;

new FFmpeg()
        .inputs("./video.mp4", "./audio.mp3")
        .options(
        	"-hide_banner",
        	"-loglevel", "verbose",
        	"-c:v", "copy",
        	"-c:a", "aac"
        )
        .output("./result.mp4")
        .execute()
        .then(() => console.log("Ok"))
        .catch(console.log);

Example 3:

// TypeScript
// import FFmpeg from "mini-ffmpeg"
const FFmpeg = require("mini-ffmpeg").default;

const audioUrl = "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3";

new FFmpeg()
        .inputs(audioUrl)
        .options("-acodec", "flac", "-b:a", "1411k")
        .output("./audio.flac")
        .execute()
        .then(() => console.log("Ok"))
        .catch(console.log);

Readme

Keywords

Package Sidebar

Install

npm i mini-ffmpeg

Weekly Downloads

52

Version

0.3.0

License

MIT

Unpacked Size

4.41 kB

Total Files

4

Last publish

Collaborators

  • erlc