kyriesent/node-rtsp-stream

"startMpeg1Stream is not a function" error

Closed this issue · 3 comments

hi guys,
I'm trying to use node-rtsp-stream and got following error on my web page.

TypeError: this.startMpeg1Stream is not a function

at VideoStream (D:\Repos\floss\ffmpegToWeb\node_modules\node-rtsp-stream\videoStream.js:22:8)

at D:\Repos\floss\ffmpegToWeb\server.js:20:14

at Layer.handle [as handle_request] (D:\Repos\floss\ffmpegToWeb\node_modules\express\lib\router\layer.js:95:5)

at next (D:\Repos\floss\ffmpegToWeb\node_modules\express\lib\router\route.js:137:13)

at Route.dispatch (D:\Repos\floss\ffmpegToWeb\node_modules\express\lib\router\route.js:112:3)

at Layer.handle [as handle_request] (D:\Repos\floss\ffmpegToWeb\node_modules\express\lib\router\layer.js:95:5)

at D:\Repos\floss\ffmpegToWeb\node_modules\express\lib\router\index.js:281:22

at Function.process_params (D:\Repos\floss\ffmpegToWeb\node_modules\express\lib\router\index.js:335:12)

at next (D:\Repos\floss\ffmpegToWeb\node_modules\express\lib\router\index.js:275:10)

at expressInit (D:\Repos\floss\ffmpegToWeb\node_modules\express\lib\middleware\init.js:40:5)

my server is just simply a express server which respond to requests and send the html back, I init the stream in the new connection callback of server.
my html is just like the example provided in the README.

Any ideas?
Thanks in advance.

just checked the source code, line 22 of videoStream.js is
this.startMpeg1Stream()
which is defined later in line 36, I'm totally new to js, but this looks correct to me, can anyone help?

3mber commented

i think you forgot to create an object from instance.

const Stream = require('node-rtsp-stream');
//const stream = Stream(); will throw the "is not function" error.
const stream = new Stream({...config});

This seems to be resolved so I am closing. Feel free to open another issue if need be.