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

RTSP Stream not coming up #246

Open
JoelCherian opened this issue Dec 16, 2023 · 5 comments
Open

RTSP Stream not coming up #246

JoelCherian opened this issue Dec 16, 2023 · 5 comments
Labels
question Further information is requested

Comments

@JoelCherian
Copy link

JoelCherian commented Dec 16, 2023

I have a rtsp stream working in VLC media player. When opening express it comes with an empty page with no errors. When i turn the verbose :true i get Stream died - will recreate when the next client connects.

const express = require('express');
const app = express();

const { proxy, scriptUrl } = require('rtsp-relay')(app);

const handler = proxy({
url: rtsp://1.1.1:554/live1.sdp,
// if your RTSP stream need credentials, include them in the URL as above
verbose: false,
});

// the endpoint our RTSP uses
app.ws('/api/stream', handler);

// this is an example html page to view the stream
app.get('/', (req, res) =>
res.send(`

<script src='${scriptUrl}'></script> <script> loadPlayer({ url: 'ws://' + location.host + '/api/stream', canvas: document.getElementById('canvas') }); </script>

`),
);

app.listen(2000);

@k-yle k-yle added the question Further information is requested label Dec 16, 2023
@drmmyx
Copy link

drmmyx commented Dec 25, 2023

same not working

@ariabd-id
Copy link

have you added the transport property? i think you should add transport="tcp" property

@drmmyx
Copy link

drmmyx commented Jan 1, 2024

i think is working

have you added the transport property? i think you should add transport="tcp" property

yes is working .... i was following exactly

Example
const express = require('express');
const app = express();

const { proxy, scriptUrl } = require('rtsp-relay')(app);

const handler = proxy({
  url: `rtsp://admin:[email protected]:554/feed`,
  // if your RTSP stream need credentials, include them in the URL as above
  verbose: false,
});

// the endpoint our RTSP uses
app.ws('/api/stream', handler);

// this is an example html page to view the stream
app.get('/', (req, res) =>
  res.send(`
  <canvas id='canvas'></canvas>

  <script src='${scriptUrl}'></script>
  <script>
    loadPlayer({
      url: 'ws://' + location.host + '/api/stream',
      canvas: document.getElementById('canvas')
    });
  </script>
`),
);

app.listen(2000);
Open http://localhost:2000/ in your web browser.

this doesnt contain transport ... so i thinking why is not working

@tuanth89
Copy link

Sorry, I have a question
I use this lib to Stream from Camera via Rtsp url.

  • with transport tcp: quality is bad and blur.
  • with no transport (not set): quality is good, same with VLC. But I deploy to Linux system, It's white screen (seem no output stream)
    @k-yle I have missing any config ?
    Thanks

@fullmooooon
Copy link

@tuanth89 Perhaps your system does not support the video encoding currently in use, such as H.265

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

6 participants