npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fffmpeg

v0.0.1-alpha.1

Published

Another node interface for ffmpeg

Downloads

4

Readme

fffmpeg Build Status Coverage Status

Currently WIP / Experimental. Will probably be very buggy.

A simple to use API for ffmpeg in node.

Installation:

npm i fffmpeg

Commands:

convertToVideo(inputFile, options, outputFile, format, cb)

Parameters:

  • inputFile: The input file to be processed.
  • options: Options to be processed when encoding the output.
  • outputFile: The name of the output file.
  • format: The output file format.
  • cb: A callback function to be executed once processing has completed.

convertToImages(inputFile, options, format, cb)

Parameters:

  • inputFile: The input file to be processed.
  • options: Options to be processed when encoding the output.
  • format: The output file format.
  • cb: A callback function to be executed once processing has completed.

convertToAudio(inputFile, options, outputFile, format, cb)

Parameters:

  • inputFile: The input file to be processed.
  • options: Options to be processed when encoding the output.
  • outputFile: The name of the output file.
  • format: The output file format.
  • cb: A callback function to be executed once processing has completed.

concatVideo(inputs, outputFile, format, cb)

Parameters:

  • inputs: An array of input files to be processed concatenated together. Each input is added using the addInput function.
  • outputFile: The name of the output file.
  • format: The output file format.
  • cb: A callback function to be executed once processing has completed.

convertToGif(inputFile, options, outputFile, cb)

Parameters:

  • inputFile: The input file to be processed.
  • options: Options to be processed when encoding the output.
  • outputFile: The name of the output file.
  • cb: A callback function to be executed once processing has completed.

Options:

addInput(inputFile, [options])

adds an input to be converted. Options is an array of options to be used for that input. Can be used to create outputs with multiple inputs for concatVideo function.

e.g.

const multipleInputs = [
  addInput('demo.mp4', [ startTime(2), duration(1) ]),
  addInput('demo.mp4', [ startTime(5), duration(2) ]),
];

concatVideo(multipleInputs, 'concatVideo', 'mp4', () => console.log('Video Finished'))  ;

audioFrames(x)

Set the number of audio frames to output.

volume(x)

Set the audio volume.

disable(a | v)

Disable either the audio (a) or video (v) track

disableAudio

Disable the audio track;

disableVideo

Disable the video track;

duration

Set the duration in seconds.

frames

Set the number of frames to be rendered.

framesPerSecond

Set the frames per second.

maxFileSize

Set the maximum rendered file size. If this option is set and the limit is reached before other options are fulfilled the render will be intercepted.

muteVideo

Mutes the audio track.

overwriteVideo(true | false)

If set to true, any files with the same name as the output filename will be overwritten without warning. Defaults to false.

setAudioBitrate(x)

Sets the audio bitrate.

setAudioCodec

Sets the audio codec to use. For a list of available codecs use the seeCodecs('a') function. NB. seeCodecs doesnt exist yet.

setAudioSpeed

Sets the AudioSpeed

setBitrate

Sets the Bitrate

setCodec

Sets the codec

setCreationTime

Sets the CreationTime

setMetaData(flag)(data)

Set the metadata for the output. Can either be an array of flag, data eg. [['flag', 'data'], ['flag2', 'data2']] or called with 2 separate strings as `setMetadata('flag')('data');

setVariableBitrate

Sets the VariableBitrate

setVideoBitrate

Sets the bitrate to be used for encoding the video.

setVideoCodec

Sets the VideoCodec. For a list of available codecs use the seeCodecs('v') function. NB. seeCodecs doesnt exist yet.

setVideoSize

Sets the VideoSize

setVideoSpeed

Sets the speed of the video to be rendered.

startTime(x)

Sets the start time in seconds as to when to start encoding, alias for seek.

seek(x)

Seek to a time in seconds as to when to start encoding, alias for startTime.

videoFrames(x)

Sets the number of video frames to render.

TODO:

  • Documentation
  • Loop video
  • Show available codecs
  • ~~Audio codec~~
  • ~~Audio Bitrate~~
  • Audio Channels
  • Audio Frequency
  • Audio Filters
  • ~~Video Codec~~
  • ~~Video Bitrate~~
  • Video Filters
  • Video Frames
  • Video frame size
  • Video Aspect ratio
  • Multiple outputs
  • FLV Format to make videos streamable
  • Video Presets
  • Complex filters

TODOs:

  • Wrap options with required values
  • TODO: Look into outputting as streams for input to the next input allowing composition of videos
  • TODO: Fix bug if video already exists.