linux – Can ffmpeg RTSP video stream be exchanged without an RTSP server?

I have two Ubuntu devices connected directly together via wired Ethernet (no router). One device (the sender) has a camera that I want to stream over RTSP, and the second device (the reciever) needs to process and view the RTSP stream. Is it possible to do this without an explicit RTSP server running on the sender?

Here is my test setup:

  • Sender

    • Static IP: 192.168.1.1/24
    • ffmpeg command: ffmpeg -f v4l2 -i /dev/video0 -pix_fmt yuv420p -f rtsp -rtsp_transport udp rtsp://192.168.1.2:12345/test
  • Receiver

    • Static IP: 192.168.1.2/24
    • ffmpeg command: ffplay rtsp://192.168.1.1:12345/test

Each machine can ping the other successfully, and both devices have their firewalls disabled. However, I get connection refused errors when trying to run each command. For resource reasons, I’m trying to avoid running an RTSP server if it isn’t necessary.

# Sender error
Connection to tcp://192.168.1.2:12345?timeout=0 failed: Connection refused
Could not write header for output file #0 (incorrect codec parameters ?): Connection refused
Error initializing output stream 0:0 --
# Receiver error
Connection to tcp://192.168.1.2:12345?timeout=0 failed: Connection refused
Connection to tcp://192.168.1.2:12345?timeout=0 failed: Connection refused

Read more here: Source link