kyriesent / node-rtsp-stream

Stream any RTSP stream and output to websocket for consumption by jsmpeg (https://github.com/phoboslab/jsmpeg). HTML5 streaming video! Requires ffmpeg.
MIT License
451 stars 166 forks source link

websocket connection error #49

Closed xwOOtx closed 4 years ago

xwOOtx commented 4 years ago

Hi, i am getting a "websocket connection to 'ws://localhost:9999/' failed" when I try to browse it on a browser. what ip/url should i configure for both ffmpeg config and jsmpeg?

Thanks

kyriesent commented 4 years ago

Not sure what the problem is, but see example:

Stream = require('node-rtsp-stream')
stream = new Stream({
  name: 'name',
  streamUrl: 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov',
  wsPort: 9999,
  ffmpegOptions: { // options ffmpeg flags
    '-stats': '', // an option with no neccessary value uses a blank string
    '-r': 30 // options with required values specify the value after the key
  }
})

The wsPort option must match whatever port you use in browser. Beyond this I'm not sure what other things might help. Thanks!

kyriesent commented 4 years ago

Also look at #37 I think someone posted a solution there.