0

I build stream server with nginx, and can push the MP4 into a rtmp stream with :

ffmpeg -re -i /mnt/hls/m7.mp4  -vcodec libx264 -vprofile baseline -g 30 -acodec aac -strict -2 -f flv rtmp://127.0.0.1/live

Now I want to push it with rtsp format:

ffmpeg -re  -i /mnt/hls/m7.mp4  -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live

Error info encountered:

[tcp @ 0x55c7d6a157c0] Connection to tcp://127.0.0.1:554?timeout=0 failed: Connection refused
Could not write header for output file #0 (incorrect codec parameters ?): Connection refused
Error initializing output stream 0:0 -- 
[aac @ 0x55c7d65b6500] Qavg: nan
[aac @ 0x55c7d65b6500] 1 frames left in the queue on closing
Conversion failed!
djdomi
  • 1,377
  • 3
  • 10
  • 19
showkey
  • 85
  • 1
  • 1
  • 14
  • imho, it seems that you remove or missing the correct encoding value, why are you changing the syntax completely? – djdomi May 06 '22 at 17:03

1 Answers1

0

It is not that seems that you remove or missing the correct encoding value.
No rtsp server build on my vps,only rtmp server ebedded in nginx on my vps.

url="https://github.com/aler9/rtsp-simple-server/releases/download/v0.18.2/rtsp-simple-server_v0.18.2_linux_amd64.tar.gz"
curl  -L $url -O 
tar -xzf rtsp-simple-server_v0.18.2_linux_amd64.tar.gz
./rtsp-simple-server

Now we can push rtsp stream on the server with ffmpeg:

ffmpeg -re  -i /mnt/hls/m7.mp4  -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live

It works fine!.

showkey
  • 85
  • 1
  • 1
  • 14