Skip to content

Commit

Permalink
fixed flashvideo preset
Browse files Browse the repository at this point in the history
  • Loading branch information
schaermu committed Apr 20, 2011
1 parent 58df701 commit 5b2bd27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/thumbnails.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var ffmpeg = require('../lib/fluent-ffmpeg');
var proc = new ffmpeg('/path/to/your_movie.avi')
// set the size of your thumbnails
.withSize('150x100')
// take 5 thumbnails evenly distributed across the movie
.takeScreenshots(5, '/path/to/thumbnail/folder', function(err) {
console.log('screenshots were saved')
// take 2 screenshots at predefined timemarks
.takeScreenshots({ count: 2, timemarks: [ '00:00:02.000', '6' ] }, '/path/to/thumbnail/folder', function(err) {
console.log('screenshots were saved');
});
8 changes: 5 additions & 3 deletions lib/fluent-ffmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,7 @@ function FfmpegProcessor(source) {

var ratio = parseInt(percentRatio[1]) / 100;
w = Math.round(data.resolution.w * ratio);
h = Math.round(data.resolution.h * ratio);

h = Math.round(data.resolution.h * ratio);
} else {
throw new Error('could not determine type of size string, aborting execution');
}
Expand Down Expand Up @@ -480,6 +479,9 @@ function FfmpegProcessor(source) {
// add video options
if (this.options.video.bitrate) {
args.push('-b', this.options.video.bitrate + 'k');
} else {
// use same quality for output as used in input
args.push('-sameq');
}
if (this.options.video.codec) {
args.push('-vcodec', this.options.video.codec);
Expand All @@ -488,7 +490,7 @@ function FfmpegProcessor(source) {
args.push('-keyint_min', this.options.video.fps);
}
if (this.options.video.aspect) {
args.push('-aspect', this.options.aspect);
args.push('-aspect', this.options.video.aspect);
}

// add video options
Expand Down
3 changes: 1 addition & 2 deletions lib/presets/flashvideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ exports.load = function(ffmpeg) {
.withSize('320x?')
.withVideoBitrate('256k')
.withFps(24)
.withAudioBitrate('128k')
.withAudioBitrate('64k')
.withAudioCodec('libmp3lame')
.withAudioFrequency(22050)
.withAudioChannels(2)
.addOptions([ '-sameq' ]);
return ffmpeg;
};

0 comments on commit 5b2bd27

Please sign in to comment.