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

codecadon

v0.1.18

Published

Async processing addon

Downloads

28

Readme

CircleCI npm version License

Codecadon

Codecadon is a Node.js addon using Javascript and C++ to implement async processing for media encoding, decoding and processing.

The implementation is designed to support the dynamorse project and currently provides packing, rescaling and encoding/decoding for h.264 and VP8, largely using FFmpeg.

Support has been added for building codecadon for the Raspberry Pi armhf platforms, although do not expect anything other than relatively poor performance at this stage.

Installation

NPM

Install Node.js for your platform. This software has been developed against the long term stable (LTS) release.

Codecadon is designed to be required to use from your own application to provide async processing. Install in your project folder with the --save option to add codecadon to the dependencies list:

npm install --save codecadon

Node.js addons use libuv which by default supports up to 4 async threads in a threadpool for activities such as file I/O. These same threads are used by codecadon and if you wish to use a number of the functions in one Node.js process then you will need to set the environment variable UV_THREADPOOL_SIZE to a suitable number before the first use of the libuv threadpool.

Example shell commands to set this variable on different platforms are:

Windows:

set UV_THREADPOOL_SIZE=16

Linux/Mac/Raspberry Pi:

export UV_THREADPOOL_SIZE=16

Using codecadon

To use codecadon in your own application, require the module then create and use workers as required. The processing functions follow a standard pattern as shown in the encoder example code below.

let codecadon = require('codecadon');

let encoder = new codecadon.Encoder(() => {
  // encoder has successfully exited
});
encoder.on('error', err => {
  // handle error
});

// send the parameters for the function (these differ by function), return value is suggested result buffer size
let dstBufLen = encoder.setInfo(srcTags, dstTags, duration, encodeTags);

// async request for processing to be done.
encoder.encode(srcBuf, Buffer.alloc(dstBufLen), (err, result) => {
  if (err) {
    // handle error
  } else if (result) {
    // result is a JS buffer containing the encoded data. Note it may be a different size to dstBuf
  }
});

// async request for the processing thread to quit when it has finished the latest request
encoder.quit(() => {
});

Status, support and further development

There is currently a limited set of video packing formats and codecs supported. There has been no attempt made to tune encoder parameters for performance or quality.

Although the architecture of codecadon is such that it could be used at scale in production environments, development is not yet complete. In its current state, it is recommended that this software is used in development environments and for building prototypes. Future development will make this more appropriate for production use.

Contributions can be made via pull requests and will be considered by the author on their merits. Enhancement requests and bug reports should be raised as github issues. For support, please contact Streampunk Media.

License

This software is released under the Apache 2.0 license. Copyright 2016 Streampunk Media Ltd.

This software uses libraries from the FFmpeg project under the LGPLv3.

Copies of the licenses pertaining to libraries used in this software can be found in the licences folder.