1.4.3 • Published 6 years ago
video-stream-monitor v1.4.3
video-stream-monitor
Installation
It needs compare
from ImageMagick package and ffmpeg
tools for work. Also it depends on POSIX shell utilites: cp
, rm
, mv
.
npm i video-stream-monitor
Usage
const options = {
fuzz: 15, //threshold, in percents
delay: 1, //delay between checks
attempts: 5, //how much equal frames in a row must be before emitting frozen event
checkFrames: {
PARENTAL_CONTROL: ['path/to/parental_frame.png'],
ERROR_MESSAGE: ['path/to/error_message.png']
},
screenshotsPath: '/tmp/', //path where screenshots shall be saved. Do not use it for UI
actualScreenshotsPath: 'public/thumbnails', //path where permanent screenshots shall be saved and updated on each check. Use it, if you want to show screenshot in UI
actualScreenshotName: 'channel_25', //filename to be used for screenshots at actualScreenshotsPath
differentPixelsLimit: 1000 //images having different pixels count below this number shall be interpreted as same (calulated after fuzz is accepted)
};
const Monitor = require('video-stream-monitor');
const instance = new Monitor('YOUR TEST STREAM URL', 'name_for_file', options);
instance.on('crash', () => console.log('ffmpeg crashed, no screenshot'));
instance.on('frame', (type) => console.log('Met frame of type ' + type));
instance.on('frozen', () => console.log('Channel FROZEN'));
instance.start();
1.4.3
6 years ago
1.4.2
7 years ago
1.4.1
7 years ago
1.4.0
7 years ago
1.3.14
7 years ago
1.3.13
7 years ago
1.3.12
7 years ago
1.3.11
7 years ago
1.3.10
7 years ago
1.3.9
7 years ago
1.3.8
7 years ago
1.3.7
7 years ago
1.3.6
7 years ago
1.3.5
7 years ago
1.3.4
7 years ago
1.3.3
7 years ago
1.3.2
7 years ago
1.3.1
7 years ago
1.3.0
7 years ago
1.2.9
7 years ago
1.2.8
7 years ago
1.2.7
7 years ago
1.2.6
7 years ago
1.2.5
7 years ago
1.2.4
7 years ago
1.2.3
7 years ago
1.2.2
7 years ago
1.2.0
7 years ago
1.1.4
7 years ago
1.1.3
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago