8000 getStreamUri not working correctly on multi channel NVR · Issue #328 · agsh/onvif · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
getStreamUri not working correctly on multi channel NVR #328
Open
@skarotech

Description

@skarotech

I have an IVSEC NVR, with multiple cameras, the connect process is showing me the multiple profile tokens (via the profiles object)

profile_0_main
profile_0_sub
profile_1_main
profile_1_sub
etc...

and when calling the getStreamUri code (my code)
// Retrieve the RTSP stream URI
cam.getStreamUri({ protocol: 'RTSP'}, (err, stream) => {
if (err) {
console.log('{"rtsp":""}');
return;
}
const rtspUrl = new URL(stream.uri);
const rtspPath = rtspUrl.pathname + rtspUrl.search;
console.log('{"rtsp":"' + rtspPath + '"}');

// Extract RTSP port
const rtspPort = rtspUrl.port || (rtspUrl.protocol === 'rtsp:' ? 554 : '');
console.log('{"rtsp_port":"' + rtspPort + '"}');

});

it returns the default camera streams
{"rtsp":"/rtsp/streaming?channel=1&subtype=0"}
{"rtsp_port":"80"}
{"mjpeg":"/rtsp/streaming?channel=1&subtype=0"}
{"mjpeg_port":"80"}
{"snapshot":"/onvif/snapshot?channel=1"}

HOWEVER when I adjust the code to add in the profile token
eg
cam.getStreamUri({ protocol: 'RTSP' , profileToken: 'profile_1_main'}, (err, stream) => {

I get no streams returned - is this a bug or expected behaviour with the library ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0