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 = ;const instance = 'YOUR TEST STREAM URL' 'name_for_file' options; instance;instance;instance;instancestart;