Skip to content

Commit cfad857

Browse files
committed
Configurable analyzeduration and probesize
1 parent 82ba725 commit cfad857

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

node_trans_server.js

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class NodeTransServer {
5959
while (i--) {
6060
let conf = this.config.trans.tasks[i];
6161
conf.ffmpeg = this.config.trans.ffmpeg;
62+
conf.analyzeDuration = this.config.trans.analyzeDuration;
63+
conf.probeSize = this.config.trans.probeSize;
6264
conf.mediaroot = this.config.http.mediaroot;
6365
conf.rtmpPort = this.config.rtmp.port;
6466
conf.streamPath = streamPath;

node_trans_session.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class NodeTransSession extends EventEmitter {
2323
let inPath = 'rtmp://127.0.0.1:' + this.conf.rtmpPort + this.conf.streamPath;
2424
let ouPath = `${this.conf.mediaroot}/${this.conf.streamApp}/${this.conf.streamName}`;
2525
let mapStr = '';
26+
let analyzeDuration = this.conf.analyzeDuration || '1000000'; // used to be 2147483647
27+
let probeSize = this.conf.probeSize || '1000000'; // used to be 2147483647
28+
2629
const random = [...Array(11)].map(i=>(~~(Math.random()*36)).toString(36)).join('');
2730

2831
if (this.conf.rtmp && this.conf.rtmpApp) {
@@ -63,7 +66,7 @@ class NodeTransSession extends EventEmitter {
6366
Logger.log('[Transmuxing FLV] ' + this.conf.streamPath + ' to ' + ouPath + '/' + flvFileName);
6467
}
6568
mkdirp.sync(ouPath);
66-
let argv = ['-y', '-flags', 'low_delay', '-fflags', 'nobuffer', '-analyzeduration', '2147483647', '-probesize', '2147483647', '-i', inPath];
69+
let argv = ['-y', '-flags', 'low_delay', '-fflags', 'nobuffer', '-analyzeduration', analyzeDuration, '-probesize', probeSize, '-i', inPath];
6770
Array.prototype.push.apply(argv, ['-c:v', vc]);
6871
Array.prototype.push.apply(argv, this.conf.vcParam);
6972
Array.prototype.push.apply(argv, ['-c:a', ac]);

0 commit comments

Comments
 (0)