codecadon
Async processing addon
Last updated 2 years ago by streampunk .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install codecadon 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.1.18                                ...           latest (2 years ago)

28 Versions

  • 0.1.18                                ...           2 years ago
  • 0.1.17                                ...           2 years ago
  • 0.1.16                                ...           3 years ago
  • 0.1.15                                ...           3 years ago
  • 0.1.14                                ...           3 years ago
  • 0.1.13                                ...           3 years ago
  • 0.1.12                                ...           3 years ago
  • 0.1.11                                ...           3 years ago
  • 0.1.10                                ...           3 years ago
  • 0.1.9                                ...           3 years ago
  • 0.1.8                                ...           3 years ago
  • 0.1.7                                ...           3 years ago
  • 0.1.6                                ...           3 years ago
  • 0.1.5                                ...           3 years ago
  • 0.1.4                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.9                                ...           4 years ago
  • 0.0.8                                ...           4 years ago
  • 0.0.7                                ...           4 years ago
  • 0.0.6                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (2)

Copyright 2014 - 2017 © taobao.org |