You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am connecting to a camera with its public Ip as it is not on my local network,
constcam=newCam({username: "xx",password: "xx",hostname: "x.x.x.x",port: x,},asyncfunction(err){if(err){console.error("Failed to connect to the camera:",err.message||err);returnreject(newError(`Connection failed: ${err.message||err}`));}awaitcam.getSnapshotUri({stream: "RTP-Multicast",protocol: "RTSP"},function(err,data){console.log(data);});});
data returns { uri: undefined }
what did i miss? or isn't it possible to take a snapshot with that connection?
The text was updated successfully, but these errors were encountered:
Spotted a few eroors in the code.
a) You only need Stream (Multicast) and Protocol (RTSP) for Get StreamUri(). You do not need them for GetSnapshotUri
b) The await on getStreamuri does nothing. The library is a "function with callback" type of library, unless you pass the library through Promisify and then you can use await and would not have a callback.
If you were trying to wait for it to finish, and then resolve a promise, you'd call resolve after console.log(data)
Spotted a few eroors in the code. a) You only need Stream (Multicast) and Protocol (RTSP) for Get StreamUri(). You do not need them for GetSnapshotUri
b) The await on getStreamuri does nothing. The library is a "function with callback" type of library, unless you pass the library through Promisify and then you can use await and would not have a callback. If you were trying to wait for it to finish, and then resolve a promise, you'd call resolve after console.log(data)
I am connecting to a camera with its public Ip as it is not on my local network,
data returns
{ uri: undefined }
what did i miss? or isn't it possible to take a snapshot with that connection?
The text was updated successfully, but these errors were encountered: