Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

renaming

  • Loading branch information...
commit 8dbdd6d15229bebc92ef2fbe51b1fcb6a11a5762 1 parent b7c2a35
@benvanik authored
View
40 README.md
@@ -1,7 +1,7 @@
-node-transcode -- Media transcoding and streaming for node.js
+node-transcoding -- Media transcoding and streaming for node.js
====================================
-node-transcode is a library for enabling both offline and real-time media
+node-transcoding is a library for enabling both offline and real-time media
transcoding. In addition to enabling the manipulation of the input media,
utilities are provided to ease serving of the output.
@@ -15,11 +15,11 @@ Coming soon (maybe):
## Quickstart
- npm install transcode
+ npm install transcoding
node
- > var transcode = require('transcode');
- > transcode.process('input.flv', 'output.m4v',
- transcode.profiles.APPLE_TV_2, function(err, sourceInfo, targetInfo) {
+ > var transcoding = require('transcoding');
+ > transcoding.process('input.flv', 'output.m4v',
+ transcoding.profiles.APPLE_TV_2, function(err, sourceInfo, targetInfo) {
console.log('completed!');
});
@@ -27,17 +27,17 @@ Coming soon (maybe):
With [npm](http://npmjs.org):
- npm install transcode
+ npm install transcoding
From source:
cd ~
- git clone https://benvanik@github.com/benvanik/node-transcode.git
- npm link node-transcode/
+ git clone https://benvanik@github.com/benvanik/node-transcoding.git
+ npm link node-transcoding/
### Dependencies
-node-transcode requires `ffmpeg` and its libraries `avformat` and `avcodec`.
+node-transcoding requires `ffmpeg` and its libraries `avformat` and `avcodec`.
Make sure it's installed and on your path. It must be compiled with libx264 to
support most output - note that some distributions don't include this and you
may have to compile it yourself. Annoying, I know.
@@ -120,8 +120,8 @@ for undefined first.
To quickly query media information (duration, codecs used, etc) use the
`queryInfo` API:
- var transcode = require('transcode');
- transcode.queryInfo(source, function(err, info) {
+ var transcoding = require('transcoding');
+ transcoding.queryInfo(source, function(err, info) {
// Completed
});
@@ -131,9 +131,9 @@ Transcoding requires a ton of parameters to get the best results. It's a pain in
the ass. So what's exposed right now is a profile set that tries to set the
best options for you. Pick your profile and pass it into the transcoding APIs.
- var transcode = require('transcode');
- for (var profileName in transcode.profiles) {
- var profile = transcode.profiles[profileName];
+ var transcoding = require('transcoding');
+ for (var profileName in transcoding.profiles) {
+ var profile = transcoding.profiles[profileName];
console.log(profileName + ':' + util.inspect(profile));
}
@@ -142,8 +142,8 @@ best options for you. Pick your profile and pass it into the transcoding APIs.
If you are doing simple offline transcoding (no need for streaming, extra
options, progress updates, etc) then you can use the `process` API:
- var transcode = require('transcode');
- transcode.process(source, target, transcode.profiles.APPLE_TV_2, {}, function(err, sourceInfo, targetInfo) {
+ var transcoding = require('transcoding');
+ transcoding.process(source, target, transcoding.profiles.APPLE_TV_2, {}, function(err, sourceInfo, targetInfo) {
// Completed
});
@@ -152,8 +152,8 @@ track events.
### Advanced Transcoding
- var transcode = require('transcode');
- var task = transcode.createTask(source, target, transcode.profiles.APPLE_TV_2);
+ var transcoding = require('transcoding');
+ var task = transcoding.createTask(source, target, transcoding.profiles.APPLE_TV_2);
task.on('begin', function(sourceInfo, targetInfo) {
// Transcoding beginning, info available
@@ -201,7 +201,7 @@ things such as client-side stream switching (changing audio channels/etc).
// TODO: API for this... something like:
// (where target is used as a base filename for all the extra stuff)
- var task = transcode.createTask(source, target, profile, {
+ var task = transcoding.createTask(source, target, profile, {
streaming: {
segmentDuration: 10,
allowCaching: true
View
4 examples/mediainfo.js
@@ -2,7 +2,7 @@
var fs = require('fs');
var path = require('path');
-var transcode = require('transcode');
+var transcoding = require('transcoding');
var util = require('util');
var opts = require('tav').set({
@@ -19,7 +19,7 @@ if (!path.existsSync(inputFile)) {
return;
}
-transcode.queryInfo(inputFile, function(err, info) {
+transcoding.queryInfo(inputFile, function(err, info) {
console.log('Info for ' + inputFile + ':');
if (err) {
console.log('Error!');
View
12 examples/transcode.js
@@ -2,7 +2,7 @@
var fs = require('fs');
var path = require('path');
-var transcode = require('transcode');
+var transcoding = require('transcoding');
var util = require('util');
var opts = require('tav').set({
@@ -14,8 +14,8 @@ var opts = require('tav').set({
if (!opts.args.length) {
console.log('All profiles:');
- for (var key in transcode.profiles) {
- var profile = transcode.profiles[key];
+ for (var key in transcoding.profiles) {
+ var profile = transcoding.profiles[key];
console.log(' ' + key + ': ' + profile.name);
}
return;
@@ -34,14 +34,14 @@ if (!path.existsSync(inputFile)) {
if (opts.args.length < 2) {
// No output given, so just query info
- transcode.queryInfo(inputFile, function(err, info) {
+ transcoding.queryInfo(inputFile, function(err, info) {
console.log('Info for ' + inputFile + ':');
console.log(util.inspect(info, false, 3));
});
return;
}
-var profile = transcode.profiles[opts['profile']];
+var profile = transcoding.profiles[opts['profile']];
if (!profile) {
console.log('unknown profile: ' + profile);
return;
@@ -55,7 +55,7 @@ if (!path.existsSync(outputPath)) {
console.log('transcoding ' + inputFile + ' -> ' + outputFile);
-var task = transcode.createTask(inputFile, outputFile, profile, {
+var task = transcoding.createTask(inputFile, outputFile, profile, {
});
task.on('begin', function(sourceInfo, targetInfo) {
// Transcoding beginning
View
6 lib/transcode.js → lib/transcoding.js
@@ -1,8 +1,8 @@
var util = require('util');
-var binding = require('./transcode/binding');
+var binding = require('./transcoding/binding');
-exports.profiles = require('./transcode/profiles');
+exports.profiles = require('./transcoding/profiles');
// Enable extra FFMPEG debug spew
binding.setDebugLevel(true);
@@ -21,7 +21,7 @@ exports.createTask = function(source, target, profile, opt_options) {
return new binding.Task(source, target, profile, opt_options || {});
};
-exports.transcode = function(source, target, profile, opt_options, callback) {
+exports.process = function(source, target, profile, opt_options, callback) {
var sourceInfoStash = null;
var targetInfoStash = null;
var task = new binding.Task(source, target, profile, opt_options || {});
View
2  lib/transcode/binding.js → lib/transcoding/binding.js
@@ -1,4 +1,4 @@
-module.exports = require('../../build/Release/node_transcode.node');
+module.exports = require('../../build/Release/node_transcoding.node');
// WEAK: required in v0.6
function inheritEventEmitter(type) {
View
0  lib/transcode/profiles.js → lib/transcoding/profiles.js
File renamed without changes
View
10 package.json
@@ -1,24 +1,26 @@
{
- "name": "transcode",
+ "name": "transcoding",
"description": "Media transcoding and streaming support",
"version": "0.0.1",
"author": "Ben Vanik <ben.vanik@gmail.com>",
"contributors": [],
"repository": {
"type": "git",
- "url": "git://github.com/benvanik/node-transcode.git"
+ "url": "git://github.com/benvanik/node-transcoding.git"
},
"keywords": [
"audio",
"video",
"media",
"transcode",
+ "transcoding",
+ "remux",
"streaming"
],
"directories": {
- "lib": "./lib/transcode"
+ "lib": "./lib/transcoding"
},
- "main": "./lib/transcode",
+ "main": "./lib/transcoding",
"bin": {
"transcode" : "./examples/transcode.js"
},
View
16 src/binding.cpp
@@ -5,10 +5,10 @@
#include "mediainfo.h"
#include "task.h"
-using namespace transcode;
+using namespace transcoding;
using namespace v8;
-namespace transcode {
+namespace transcoding {
static Handle<Value> setDebugLevel(const Arguments& args) {
HandleScope scope;
@@ -61,19 +61,19 @@ static Handle<Value> queryInfo(const Arguments& args) {
return scope.Close(Undefined());
}
-}; // transcode
+}; // transcoding
-extern "C" void node_transcode_init(Handle<Object> target) {
+extern "C" void node_transcoding_init(Handle<Object> target) {
HandleScope scope;
// One-time prep
av_register_all();
av_log_set_level(AV_LOG_QUIET);
- transcode::Task::Init(target);
+ transcoding::Task::Init(target);
- NODE_SET_METHOD(target, "setDebugLevel", transcode::setDebugLevel);
- NODE_SET_METHOD(target, "queryInfo", transcode::queryInfo);
+ NODE_SET_METHOD(target, "setDebugLevel", transcoding::setDebugLevel);
+ NODE_SET_METHOD(target, "queryInfo", transcoding::queryInfo);
}
-NODE_MODULE(node_transcode, node_transcode_init);
+NODE_MODULE(node_transcoding, node_transcoding_init);
View
6 src/io.cpp
@@ -2,7 +2,7 @@
#include <node_buffer.h>
using namespace node;
-using namespace transcode;
+using namespace transcoding;
IOHandle::IOHandle(Handle<Object> source) {
HandleScope scope;
@@ -157,7 +157,7 @@ LiveStreamingHandle::LiveStreamingHandle(Handle<Object> source) :
LiveStreamingHandle::~LiveStreamingHandle() {
}
-AVFormatContext* transcode::createInputContext(IOHandle* input, int* pret) {
+AVFormatContext* transcoding::createInputContext(IOHandle* input, int* pret) {
AVFormatContext* ctx = NULL;
int ret = 0;
*pret = 0;
@@ -194,7 +194,7 @@ AVFormatContext* transcode::createInputContext(IOHandle* input, int* pret) {
return NULL;
}
-AVFormatContext* transcode::createOutputContext(IOHandle* output, int* pret) {
+AVFormatContext* transcoding::createOutputContext(IOHandle* output, int* pret) {
AVFormatContext* ctx = NULL;
int ret = 0;
*pret = 0;
View
10 src/io.h
@@ -2,12 +2,12 @@
#include <v8.h>
#include "utils.h"
-#ifndef NODE_TRANSCODE_IO
-#define NODE_TRANSCODE_IO
+#ifndef NODE_TRANSCODING_IO
+#define NODE_TRANSCODING_IO
using namespace v8;
-namespace transcode {
+namespace transcoding {
class IOHandle {
public:
@@ -71,6 +71,6 @@ class LiveStreamingHandle : public IOHandle {
AVFormatContext* createInputContext(IOHandle* input, int* pret);
AVFormatContext* createOutputContext(IOHandle* output, int* pret);
-}; // transcode
+}; // transcoding
-#endif // NODE_TRANSCODE_IO
+#endif // NODE_TRANSCODING_IO
View
4 src/mediainfo.cpp
@@ -1,9 +1,9 @@
#include "mediainfo.h"
-using namespace transcode;
+using namespace transcoding;
using namespace v8;
-Handle<Object> transcode::createMediaInfo(AVFormatContext* ctx, bool encoding) {
+Handle<Object> transcoding::createMediaInfo(AVFormatContext* ctx, bool encoding) {
HandleScope scope;
Local<Object> result = Object::New();
View
10 src/mediainfo.h
@@ -2,15 +2,15 @@
#include <v8.h>
#include "utils.h"
-#ifndef NODE_TRANSCODE_MEDIAINFO
-#define NODE_TRANSCODE_MEDIAINFO
+#ifndef NODE_TRANSCODING_MEDIAINFO
+#define NODE_TRANSCODING_MEDIAINFO
using namespace v8;
-namespace transcode {
+namespace transcoding {
Handle<Object> createMediaInfo(AVFormatContext* ctx, bool encoding);
-}; // transcode
+}; // transcoding
-#endif // NODE_TRANSCODE_MEDIAINFO
+#endif // NODE_TRANSCODING_MEDIAINFO
View
2  src/profile.cpp
@@ -1,6 +1,6 @@
#include "profile.h"
-using namespace transcode;
+using namespace transcoding;
using namespace v8;
CodecOptions::CodecOptions(Handle<Object> source) :
View
10 src/profile.h
@@ -4,12 +4,12 @@
#include <vector>
#include "utils.h"
-#ifndef NODE_TRANSCODE_PROFILE
-#define NODE_TRANSCODE_PROFILE
+#ifndef NODE_TRANSCODING_PROFILE
+#define NODE_TRANSCODING_PROFILE
using namespace v8;
-namespace transcode {
+namespace transcoding {
class CodecOptions {
public:
@@ -51,6 +51,6 @@ class Profile {
std::vector<VideoCodecOptions*> videoCodecs;
};
-}; // transcode
+}; // transcoding
-#endif // NODE_TRANSCODE_PROFILE
+#endif // NODE_TRANSCODING_PROFILE
View
2  src/task.cpp
@@ -1,7 +1,7 @@
#include "task.h"
#include "mediainfo.h"
-using namespace transcode;
+using namespace transcoding;
using namespace v8;
typedef struct TaskAsyncRequest_t {
View
10 src/task.h
@@ -5,12 +5,12 @@
#include "profile.h"
#include "taskcontext.h"
-#ifndef NODE_TRANSCODE_TASK
-#define NODE_TRANSCODE_TASK
+#ifndef NODE_TRANSCODING_TASK
+#define NODE_TRANSCODING_TASK
using namespace v8;
-namespace transcode {
+namespace transcoding {
class Task : public node::ObjectWrap {
public:
@@ -61,6 +61,6 @@ class Task : public node::ObjectWrap {
Progress progress;
};
-}; // transcode
+}; // transcoding
-#endif // NODE_TRANSCODE_TASK
+#endif // NODE_TRANSCODING_TASK
View
2  src/taskcontext.cpp
@@ -1,6 +1,6 @@
#include "taskcontext.h"
-using namespace transcode;
+using namespace transcoding;
TaskContext::TaskContext(IOHandle* input, IOHandle* output, Profile* profile) :
running(false), abort(false), err(0),
View
10 src/taskcontext.h
@@ -4,12 +4,12 @@
#include "io.h"
#include "profile.h"
-#ifndef NODE_TRANSCODE_TASKCONTEXT
-#define NODE_TRANSCODE_TASKCONTEXT
+#ifndef NODE_TRANSCODING_TASKCONTEXT
+#define NODE_TRANSCODING_TASKCONTEXT
using namespace v8;
-namespace transcode {
+namespace transcoding {
typedef struct Progress_t {
double timestamp;
@@ -52,6 +52,6 @@ class TaskContext {
AVFormatContext* octx;
};
-}; // transcode
+}; // transcoding
-#endif // NODE_TRANSCODE_TASKCONTEXT
+#endif // NODE_TRANSCODING_TASKCONTEXT
View
10 src/utils.h
@@ -7,10 +7,10 @@ extern "C" {
#include "libavcodec/avcodec.h"
}
-#ifndef NODE_TRANSCODE_UTILS
-#define NODE_TRANSCODE_UTILS
+#ifndef NODE_TRANSCODING_UTILS
+#define NODE_TRANSCODING_UTILS
-namespace transcode {
+namespace transcoding {
#ifndef countof
#ifdef _countof
@@ -63,6 +63,6 @@ static double V8GetNumber(v8::Handle<v8::Object> obj, const char* name,
}
}
-}; // transcode
+}; // transcoding
-#endif // NODE_TRANSCODE_UTILS
+#endif // NODE_TRANSCODING_UTILS
View
2  wscript
@@ -30,7 +30,7 @@ def configure(conf):
def build(bld):
t = bld.new_task_gen('cxx', 'shlib', 'node_addon')
- t.target = 'node_transcode'
+ t.target = 'node_transcoding'
t.cxxflags = ['-D__STDC_CONSTANT_MACROS']
t.uselib = ['LIBAVUTIL', 'LIBAVFORMAT', 'LIBAVCODEC']
t.source = [

0 comments on commit 8dbdd6d

Please sign in to comment.
Something went wrong with that request. Please try again.