JSPM

mini-ffmpeg

0.3.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 16
    • Score
      100M100P100Q49845F
    • License MIT

    Simple ffmpeg wrapper.

    Package Exports

    • mini-ffmpeg
    • mini-ffmpeg/dist/ffmpeg.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mini-ffmpeg) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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);