AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
7.09k stars 508 forks source link

Problems adding new line to yaml config file via api #1275

Open esthar992 opened 4 months ago

esthar992 commented 4 months ago

I've encountered two issues trying to insert new lines inside the config yml file with api endpoints for streams.

1) Can't insert something like : exec:ffmpeg -rtsp_transport udp_multicast -i "rtsp://user:pwd@xxx.xxx.xx.xx:554/cam/realmonitor?channel=1&subtype=0&unicast=false" -vf "scale=1920:1080" -preset ultrafast -c:v libx264 -rtsp_transport tcp -f rtsp {output}

Inside the yml file, receiving a bad request response (400). I need this for dynamic insert from my web app to go 2 rtc.

Looking at the code it seems that the endpoint will block everything different from a standard url without spaces, but i think this is a big limitation (go2rtc can effortlessly handle commands like this manually inserted in the yml config file).

2) If we have multiline stream commands inside the config file, the endpoint will insert in the wrong position, breaking the multiline command if it's the last one:

Schermata del 2024-07-23 08-40-22

The endpoint used in this case is POST /api/streams

Thanks.

AlexxIT commented 4 months ago
  1. API block spaces in source for security reason. This won't change until the access rights are redesigned.
  2. You need to read more about YAML format, multiline, lists, etc.

https://yaml-multiline.info/