-
Notifications
You must be signed in to change notification settings - Fork 5
/
ff.js
28 lines (27 loc) · 874 Bytes
/
ff.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var outputh = 'rtsp://' + 'ip' + ':' + 'port' + '/' + textname;
var ffmpegPath = "./ffmpeg_bin/ffmpeg.exe";
var ffmpeg = require('fluent-ffmpeg');
command = new ffmpeg('video=HD USB Camera')
.setFfmpegPath(ffmpegPath)
.inputOptions('-f dshow')
.size('800x600')
.on('start', function(commandLine) {
console.log("start push......." + commandLine);
console.log("start command......." + command);
})
.on('end', function() {
console.log("storp push........")
stopPush();
})
.on('error', function(err, stdout, stderr) {
console.log('error:' + err.message);
console.log('stdout:' + stdout);
console.log('stderr:' + stderr);
stopPush();
})
.addOptions([
// '-preset veryfast',
'-rtsp_transport tcp',
'-f rtsp'
])
.pipe(outputh, { end: true });`