Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Reconnect after RSTP restarted or new websocket conection #209

Open
rifalgrp opened this issue May 5, 2023 · 0 comments
Open

Not Reconnect after RSTP restarted or new websocket conection #209

rifalgrp opened this issue May 5, 2023 · 0 comments
Labels
question Further information is requested

Comments

@rifalgrp
Copy link

rifalgrp commented May 5, 2023

So i have express server running on ubuntu with pm2, i have follow sample usage with many cameras, let say i have 3 camera than i start server with pm2 start express.js, everythings work perfectly, but let say if one or two camera is shutdown and power on again i cant see stream that one or two camera until pm2 restart express. its also happen if i add 4th camera dynamically just change ws parameter right? but i still need to pm2 restart express for it works.

express code

const express = require('express');
const app = express();
const { proxy, scriptUrl } = require('rtsp-relay')(app);
process.setMaxListeners(0);
app.ws('/api/stream/:cameraIP', (ws, req) =>
    proxy({
        url: `rtsp://user:pass@${req.params.cameraIP}/Streaming/channels/102`,
        additionalFlags: ['-q', '1'],
        transport: 'tcp',
    })(ws),);
app.listen(2000);

then my frontend vue js

loadPlayer({
   url: domain + ipCam,
   canvas: document.getElementById("video-canvasX" + this.canv),
});

How i can handle this problem without pm2 restart express when :

  • camera off and on again
  • add new camera
    this dynamic websocket /api/stream/:cameraIP not working before pm2 restart

thanks

@k-yle k-yle added the question Further information is requested label May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants