RTSPtoWeb icon indicating copy to clipboard operation
RTSPtoWeb copied to clipboard

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

Open codecodingg opened this issue 2 years ago • 3 comments

adding nvr playback url with api : rtsp://admin:[email protected]:554/Streaming/tracks/1501?starttime=20230615T000420z&endtime=20230615T002134z

in config file url become : rtsp://admin:[email protected]: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:[email protected]: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:[email protected]:554/Streaming/tracks/1501?starttime=20230615T000420z\u0026endtime=20230615T002134z" } }, "name": "playback" }

codecodingg avatar Jul 28 '23 14:07 codecodingg

adding nvr playback url with api : rtsp://admin:[email protected]:554/Streaming/tracks/1501?starttime=20230615T000420z&endtime=20230615T002134z

in config file url become : rtsp://admin:[email protected]: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:[email protected]: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:[email protected]: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 avatar Nov 02 '23 05:11 bbhxwl

adding nvr playback url with api : rtsp://admin:[email protected]:554/Streaming/tracks/1501?starttime=20230615T000420z&endtime=20230615T002134z

in config file url become : rtsp://admin:[email protected]: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:[email protected]: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:[email protected]:554/Streaming/tracks/1501?starttime=20230615T000420z\u0026endtime=20230615T002134z" } }, "name": "playback" }

Have you solved it?

bbhxwl avatar Nov 02 '23 07:11 bbhxwl

not yet

codecodingg avatar Nov 04 '23 18:11 codecodingg