Skip to content

Instantly share code, notes, and snippets.

@tieleman
Last active August 29, 2015 13:57
Show Gist options
  • Save tieleman/9629190 to your computer and use it in GitHub Desktop.
Save tieleman/9629190 to your computer and use it in GitHub Desktop.
PoC NodeJS script which reads an input MPEG-TS and pipes it to stdout in a loop to be transcoded/segmented by ffmpeg.
var fs = require('fs');
function processStream() {
var readStream = fs.createReadStream('../../counter_0_120.ts');
readStream.on('open', function () {
readStream.pipe(process.stdout, { end: false });
});
readStream.on('end', function() {
processStream();
})
}
processStream();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment