I am trying to start the relay of the rtsp stream on the server. I write a command mind

ffmpeg -i rtsp://192.168.1.1:554/user=admin&password=123&channel=1&stream=0.sdp -c copy -f flv rtmp://127.0.0.1/bana/stream_1; 

And the command does not start, because he doesn’t like the & sign. Tried to take the string in quotes

 "rtsp://192.168.1.1:554/user=admin&password=123&channel=1&stream=0.sdp" 

did not help. I tried to put in front of the sign & ^ and backslash - did not help. What other solutions are there?

Or can someone tell me how to build another link, because I have other links like

 rtsp://admin:123@192.168.1.1:554/Streaming/Channels/101 

which work well. I tried to bring the first link to this form - it does not work

System - Debian 8

  • parameters in url are separated from the rest by symbol ? . quotes in this case are required, and single is best. - aleksandr barakin
  • do you mean to write like rtsp://192.168.1.1:554/?user=admin&password=123&channel=1&stream=0.sdp ? - Diefair
  • Yes, and do not forget to enclose this entire line in quotes. - aleksandr barakin
  • Received this Could not find codec parameters for stream 0 (Video: h264, 1 reference frame, none(left)): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options - Diefair
  • and at the end it’s still Output file #0 does not contain any stream - Diefair

1 answer 1

 ffmpeg -i rtsp://192.168.1.1:554/user=admin&password=123&channel=1&stream=0.sdp ... 

parameters in url are separated from the rest by symbol ? . quotes in this case are required, and single ones are better:

 ffmpeg -i 'rtsp://192.168.1.1:554/?user=admin&password=123&channel=1&stream=0.sdp' ...