scottlamb / retina

High-level RTSP multimedia streaming library, in Rust
https://crates.io/crates/retina
Apache License 2.0
244 stars 48 forks source link

Unsupported Transport response to SETUP CSeq=2: Unexpected RTSP response status #103

Closed overheat closed 6 months ago

overheat commented 6 months ago

I use a raspberry pi to simulated a RTSP server, like this:

libcamera-vid -t 0 --inline --width 1332 --height 990 --framerate 30 -o - | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/stream}' :demux=h264

Why have this error?

Unsupported Transport response to SETUP CSeq=2: Unexpected RTSP response status

when this:

../../target/debug/client mp4 --url rtsp://192.168.31.190:8554/stream out.mp4
W20240516 11:24:48.510 main retina::codec::h264] Ignoring bad H.264 format-specific-params "packetization-mode=1;profile-level-id=640028;sprop-parameter-sets=J2QAKKwrQCoD7z1CAAADAAIAAAMAeclAAExLAAC+vN73APEiag==,KO4CXLA=;": key without value
I20240516 11:24:48.511 main client::mp4] Using h264 video stream
E20240516 11:24:48.537 main client] Fatal: Unsupported Transport response to SETUP CSeq=2: Unexpected RTSP response status

conn: 192.168.31.165:56838(me)->192.168.31.190:8554@2024-05-16T11:24:48
msg: 686@2024-05-16T11:24:48
scottlamb commented 6 months ago

That's saying that Retina sent a SETUP request, and the RTSP server responded with status Unsupported.

I have a Pi sitting around with a camera, so I was able to reproduce with your command. I think the problem is that this RTSP server only supports UDP, and Retina defaults to TCP. You can add --transport udp --allow-loss to your Retina command and get a bit further.

After I do that, Retina starts up then complains a few seconds later about backward time jump. The Retina API allows you to permit this but I don't think the example program supports it right now.