sahilchaddha / node-rtsp-recorder

Records and saves RTSP Video Streams
66 stars 29 forks source link

Wrong url returns normal captureImage #15

Open zinen opened 3 years ago

zinen commented 3 years ago

Inputting like a fake url when capturing images and captureImage just returns just normal. I would expect that an error was thrown or captureImage to return like false or someting.

Input url with: 1.1.1.1 or a string hi and everything just runs normaly but without generating a file.

Could this module give some feedback to weather a file was generated for me to handle when calling captureImage()?

    const Recorder = require('node-rtsp-recorder').Recorder

    var rec = new Recorder({
        url: 'hi',
        folder: '/Users/sahilchaddha/Sahil/Projects/Github/node-rtsp-recorder/videos',
        name: 'cam1',
        type: 'image',
    })

    rec.captureImage(() => {
        console.log('Image Captured')
    })