You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem where when rtsp path has user and password, for example example of my yml configuration:
paths:
camera1:
source: "rtsp://192.168.147.252"
mycam:
source: "rtsp://admin:admin@192.168.2.56"
the problem is camera1 runs well in hsl playback and when I embed it to the web it runs well, but mycam has a problem even though when accessing RTSP on mediamtx it runs well rtsp://localhost:8554/mycam I checked it in vlc it runs normally but when embedding in html it always 404 not found.
example of how I do embedding:
<title>CCTV Stream</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.4.10/hls.min.js"></script>
<style>
.video-container {
max-width: 800px;
margin: 20px auto;
}
video {
width: 100%;
}
</style>
<script>
var video = document.getElementById('video');
var videoSrc = 'http://127.0.0.1:8888/mycam/index.m3u8';
if (Hls.isSupported()) {
var hls = new Hls();
hls.loadSource(videoSrc);
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, function() {
video.play();
});
}
else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = videoSrc;
video.addEventListener('loadedmetadata', function() {
video.play();
});
}
</script>
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Question
I have a problem where when rtsp path has user and password, for example example of my yml configuration:
<title>CCTV Stream</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.4.10/hls.min.js"></script> <style> .video-container { max-width: 800px; margin: 20px auto; } video { width: 100%; } </style>paths:
camera1:
source: "rtsp://192.168.147.252"
mycam:
source: "rtsp://admin:admin@192.168.2.56"
the problem is camera1 runs well in hsl playback and when I embed it to the web it runs well, but mycam has a problem even though when accessing RTSP on mediamtx it runs well rtsp://localhost:8554/mycam I checked it in vlc it runs normally but when embedding in html it always 404 not found.
example of how I do embedding:
but when I access the path camera1 var videoSrc = 'http://127.0.0.1:8888/camera1/index.m3u8';
runs normally, is there a problem with my settings?.
I attach my settings.
mediamtx.txt
Beta Was this translation helpful? Give feedback.
All reactions