Git Product home page Git Product logo

ff-util's Introduction

FF Util

A set of useful utilities for running ffmpeg with node

Build Status npm version Coverage Status

Installation

First make sure you have the ffmpeg binary downloaded and globally accessible on your machine.

Next, install FF Util via NPM:

npm install ff-util

Usage

import { run } from 'ff-util';

const args = [
    '-i', './video.mov',
    './video.mp4'
]

run({args})
    .then(() => console.log('process complete!'))

With parsed progress:

import { run, parse } from 'ff-util';

const args = [
    '-i', './video.mov',
    './video.mp4'
]

const logger = (stdOut: string) => {
    const parsed = parse({ffProgressLine: stdOut})
    console.log({parsed})
}

run({args, logger})
    .then(() => console.log('process complete!'))

Planned features

Feature Status
Simple Runner
Progress Parser
Progress Percent & ETA
Pause/Resume process
Structured & typed ffmpeg args
Process splitter and restitcher for parallel encoding *
(*) Useful for blazing-fast transcoding in a distributed infrastructure like Kubernetes, AWS Lambda, etc.

ff-util's People

Contributors

salmoro avatar

Watchers

 avatar

ff-util's Issues

open up access to inner parts

Hi @salmoro ! thank you for publishing this handy tool.

I was checking the snippet code published at https://gist.github.com/Drubo/1574291 and I would like to use ff-util to achieve similar results. My goal is to transcode a video on-the-fly (-i pipe:0), so I need to have access to ffmpegProcess.stdin.

I see a few ways to achieve that, but all of them require changing your lib:

  • create a inputStream in RunnerProps
  • refactor run to return a custom object in which the promise is just one of its atrributes: run(...).promise, run().process, ...
  • still return a promise from run, but "attach" the process to it: promise = run(...); promise.process.stdin

The best choice depends on how you foresee other parts of the lib growing from here :)

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.