-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlivecam.js
More file actions
50 lines (39 loc) · 1.43 KB
/
livecam.js
File metadata and controls
50 lines (39 loc) · 1.43 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const LiveCam = require('livecam');
const webcam_server = new LiveCam
({
// address and port of the webcam UI
'ui_addr' : '192.168.1.117',
'ui_port' : 11000,
// address and port of the webcam Socket.IO server
// this server broadcasts GStreamer's video frames
// for consumption in browser side.
'broadcast_addr' : '192.168.1.117',
'broadcast_port' : 12000,
// address and port of GStreamer's tcp sink
'gst_tcp_addr' : '192.168.1.117',
'gst_tcp_port' : 10000,
// callback function called when server starts
'start' : function() {
console.log('WebCam server started!');
},
// webcam object holds configuration of webcam frames
'webcam' : {
// should frames be converted to grayscale (default : false)
'grayscale' : true,
// should width of the frame be resized (default : 0)
// provide 0 to match webcam input
'width' : 800,
// should height of the frame be resized (default : 0)
// provide 0 to match webcam input
'height' : 600,
// should a fake source be used instead of an actual webcam
// suitable for debugging and development (default : false)
'fake' : false,
// framerate of the feed (default : 0)
// provide 0 to match webcam input
'framerate' : 7,
// macos only: select the webcam via index
'deviceIndex' : 1
}
});
webcam_server.broadcast();