Permalink
Browse files

fixed examples (closes #42

  • Loading branch information...
1 parent a0ef5a5 commit 94ff37b5dc7239b43e059d5ad66b73f0a2a25a47 @schaermu schaermu committed Apr 23, 2012
@@ -13,7 +13,7 @@ app.get('/video/:filename', function(req, res) {
res.contentType('flv');
// make sure you set the correct path to your video file storage
var pathToMovie = '/path/to/storage/' + req.params.filename;
- var proc = new ffmpeg(pathToMovie)
+ var proc = new ffmpeg({ source: pathToMovie, nolog: true })
// use the 'flashvideo' preset (located in /lib/presets/flashvideo.js)
.usingPreset('flashvideo')
// save to stream
View
@@ -1,7 +1,7 @@
var ffmpeg = require('../lib/fluent-ffmpeg');
// make sure you set the correct path to your video file
-var proc = new ffmpeg('/path/to/your_movie.avi')
+var proc = new ffmpeg({ source: '/path/to/your_movie.avi', nolog: true })
// set video bitrate
.withVideoBitrate(1024)
// set target codec
View
@@ -2,15 +2,15 @@ var fs = require('fs'),
ffmpeg = require('./lib/fluent-ffmpeg');
// open input stream
-var infs = fs.createReadStream(__dirname + '/test/assets/testvideo.avi');
+var infs = fs.createReadStream(__dirname + '/test/assets/testvideo-43.avi');
infs.on('error', function(err) {
console.log(err);
});
// create new ffmpeg processor instance using input stream
// instead of file path (can be any ReadableStream)
-var proc = new ffmpeg(infs)
+var proc = new ffmpeg({ source: infs, nolog: true })
.usingPreset('flashvideo')
.saveToFile('/path/to/your_target.flv', function(stdout, stderr, err) {
console.log('done processing input stream');
View
@@ -1,6 +1,6 @@
var ffmpegmeta = require('../lib/fluent-ffmpeg').Metadata;
// make sure you set the correct path to your video file
-ffmpegmeta.get('/path/to/your_movie.avi', function(metadata) {
+ffmpegmeta.get('/path/to/your_movie.avi', function(metadata, err) {
console.log(require('util').inspect(metadata, false, null));
});
View
@@ -1,7 +1,7 @@
var ffmpeg = require('../lib/fluent-ffmpeg');
// make sure you set the correct path to your video file
-var proc = new ffmpeg('/path/to/your_movie.avi')
+var proc = new ffmpeg({ source: '/path/to/your_movie.avi', nolog: true })
// use the 'podcast' preset (located in /lib/presets/podcast.js)
.usingPreset('podcast')
// in case you want to override the preset's setting, just keep chaining
View
@@ -0,0 +1,19 @@
+var fs = require('fs'),
+ ffmpeg = require('./lib/fluent-ffmpeg');
+
+// open input stream
+var infs = fs.createReadStream(__dirname + '/test/assets/testvideo-43.avi');
+
+infs.on('error', function(err) {
+ console.log(err);
+});
+
+var proc = new ffmpeg({ source: infs, nolog: true })
+ .usingPreset('flashvideo')
+ // set the callback for our progress notification
+ .onProgress(function(info) {
+ console.log('progress ' + info.percent + '%');
+ })
+ .saveToFile('/path/to/your_target.flv', function(stdout, stderr, err) {
+ console.log('done processing input stream');
+ });
View
@@ -5,7 +5,7 @@ var ffmpeg = require('../lib/fluent-ffmpeg'),
var stream = fs.createWriteStream('/path/to/yout_target.flv')
// make sure you set the correct path to your video file
-var proc = new ffmpeg('/path/to/your_movie.avi')
+var proc = new ffmpeg({ source: '/path/to/your_movie.avi', nolog: true })
// use the 'flashvideo' preset (located in /lib/presets/flashvideo.js)
.usingPreset('flashvideo')
// save to stream
View
@@ -1,6 +1,6 @@
var ffmpeg = require('../lib/fluent-ffmpeg');
-var proc = new ffmpeg('/path/to/your_movie.avi')
+var proc = new ffmpeg({ source: '/path/to/your_movie.avi', nolog: true })
// set the size of your thumbnails
.withSize('150x100')
// take 2 screenshots at predefined timemarks
View
@@ -1,6 +1,6 @@
{
"name": "fluent-ffmpeg",
- "version": "0.3.0",
+ "version": "1.0.0",
"description": "A fluent API to FFMPEG (http://www.ffmpeg.org)",
"keywords": [ "ffmpeg" ],
"author": "Stefan Schaermeli <schaermu@gmail.com>",

0 comments on commit 94ff37b

Please sign in to comment.