Skip to content

Commit

Permalink
Adding ability to disable quality option. Some systems does not suppo…
Browse files Browse the repository at this point in the history
…rt this option and can display cropped image. In order to disable quality you should set quality option to false (ex : new rtsp.FFMpeg({input: uri, resolution: '1280x720', quality:false, rate:10});)
  • Loading branch information
Zombitch committed Sep 4, 2017
1 parent 12820af commit 1e7e9fa
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/rtsp-ffmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var FFMpeg = function(options) {
}
this.rate = options.rate || 10;
this.resolution = options.resolution;
this.quality = options.quality || '3';
this.quality = (options.quality === undefined || options.quality === "") ? 3 : options.quality;
this.arguments = options.arguments || [];

this.on('newListener', newListener.bind(this));
Expand Down Expand Up @@ -67,14 +67,16 @@ FFMpeg.prototype._args = function() {
return this.arguments.concat([
'-loglevel', 'quiet'
, '-i', this.input
, '-r', this.rate.toString()
, '-r', this.rate.toString()]
, this.quality ? ['-q:v', this.quality.toString()] : [],
[
//, '-vf', 'fps=25'
, '-q:v', this.quality.toString()
//, '-b:v', '32k'
, '-f', 'image2'
'-f', 'image2'
, '-updatefirst', '1'
, '-'
], this.resolution ? ['-s', this.resolution] : []);
]
, this.resolution ? ['-s', this.resolution] : []);
};

/**
Expand Down

0 comments on commit 1e7e9fa

Please sign in to comment.