Created
October 15, 2013 13:54
-
-
Save tkjaergaard/6991943 to your computer and use it in GitHub Desktop.
Fluent-ffmpeg test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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