The avconv utility can be made to work in 'the Unix way' by specifying stdin and/or stdout instead of filenames for the input and output respectively. See: http://libav.org/avconv.html#pipe
Example:
cat input.ts | avconv -i pipe:0 -f mp4 -movflags frag_keyframe pipe:1 | cat > output.mp4
Using node's require('child_process').spawn()
, we can pipe streams of video data through avconv's stdin and stdout and thus Stream All The Things.
var fs = require('fs');
var child = require('child_process');
var input_file = fs.createReadStream('./input.ts');
var output_file = fs.createWriteStream('./output.mp4');
var args = ['-i', 'pipe:0', '-f', 'mp4', '-movflags', 'frag_keyframe', 'pipe:1'];
var trans_proc = child.spawn('avconv', args, null);
input_file.pipe(trans_proc.stdin);
trans_proc.stdout.pipe(output_file);
trans_proc.stderr.on('data', function (data) {
console.log(data.toString());
});
ok. This should fit nicely in navcodec, I will take a look at it asap.