deepch / RTSPtoWeb

RTSP Stream to WebBrowser
MIT License
1.33k stars 314 forks source link

API add stream character & is encoded as \u0026,cause the rtsp read to fail #367

Open codecodingg opened 1 year ago

codecodingg commented 1 year ago

adding nvr playback url with api : rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z&endtime=20230615T002134z

in config file url become : rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z\u0026endtime=20230615T002134z

then read rtsp fail

axios: const axios = require('axios'); let data = JSON.stringify({ "name": "playback", "channels": { "0": { "name": "ch1", "url": "rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z&endtime=20230615T002134z", "on_demand": true, "debug": false, "status": 0 } } });

let config = { method: 'post', maxBodyLength: Infinity, url: 'http://127.0.0.1:8083/stream/playback/add', headers: { 'Content-Type': 'application/json', 'Authorization': 'Basic ZGVtbzpkZW1v' }, data : data };

axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); });

config file stream: "playback": { "channels": { "0": { "name": "ch1", "on_demand": true, "url": "rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z\u0026endtime=20230615T002134z" } }, "name": "playback" }

bbhxwl commented 1 year ago

adding nvr playback url with api : rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z&endtime=20230615T002134z

in config file url become : rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z\u0026endtime=20230615T002134z

then read rtsp fail

axios: const axios = require('axios'); let data = JSON.stringify({ "name": "playback", "channels": { "0": { "name": "ch1", "url": "rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z&endtime=20230615T002134z", "on_demand": true, "debug": false, "status": 0 } } });

let config = { method: 'post', maxBodyLength: Infinity, url: 'http://127.0.0.1:8083/stream/playback/add', headers: { 'Content-Type': 'application/json', 'Authorization': 'Basic ZGVtbzpkZW1v' }, data : data };

axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); });

config file stream: "playback": { "channels": { "0": { "name": "ch1", "on_demand": true, "url": "rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z\u0026endtime=20230615T002134z" } }, "name": "playback" }

Do I need to add a new one every time I play back? Is there no way to replace strings for playback customization?

bbhxwl commented 1 year ago

adding nvr playback url with api : rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z&endtime=20230615T002134z

in config file url become : rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z\u0026endtime=20230615T002134z

then read rtsp fail

axios: const axios = require('axios'); let data = JSON.stringify({ "name": "playback", "channels": { "0": { "name": "ch1", "url": "rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z&endtime=20230615T002134z", "on_demand": true, "debug": false, "status": 0 } } });

let config = { method: 'post', maxBodyLength: Infinity, url: 'http://127.0.0.1:8083/stream/playback/add', headers: { 'Content-Type': 'application/json', 'Authorization': 'Basic ZGVtbzpkZW1v' }, data : data };

axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); });

config file stream: "playback": { "channels": { "0": { "name": "ch1", "on_demand": true, "url": "rtsp://admin:admin123@192.168.5.10:554/Streaming/tracks/1501?starttime=20230615T000420z\u0026endtime=20230615T002134z" } }, "name": "playback" }

Have you solved it?

codecodingg commented 1 year ago

not yet