Skip to content

Instantly share code, notes, and snippets.

@tkjaergaard
Created October 15, 2013 13:54
Show Gist options
  • Select an option

  • Save tkjaergaard/6991943 to your computer and use it in GitHub Desktop.

Select an option

Save tkjaergaard/6991943 to your computer and use it in GitHub Desktop.
Fluent-ffmpeg test
var ffmpeg = require('fluent-ffmpeg'),
express = require('express');
var app = express();
app.get('/video/:filename', function(req, res) {
res.contentType('ogg');
var pathToMovie = 'video/' + req.params.filename; // be-s1e1.avi
var proc = new ffmpeg({ source: pathToMovie, nolog: false })
.withVideoCodec('libtheora')
.withAudioCodec('libvorbis')
.toFormat('ogg')
.withVideoBitrate('500k')
.writeToStream(res, function(retcode, error){
console.log('file has been converted succesfully');
});
});
var server = app.listen(4000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment