ffmpeg:rtsp报错method SETUP failed: 461 Unsupported Transport

report error

When trying ffmpeg to request rtsp stream, the UDP port cannot return

[rtsp @ 0x5650696e2580] UDP timeout, retrying with TCP
[rtsp @ 0x5650696e2580] method SETUP failed: 454 Session Not Found
[rtsp @ 0x5650696e2580] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options

solve

Force ffmpeg to try the tcp protocol when pulling streams to rtsp, which is currently valid, plus the -rtsp_transport tcp parameter

ffmpeg -rtsp_transport tcp -i 'rtsp://admin:[email protected]:554/cam/realmonitor?channel=17&subtype=0' -an -c:v copy -f mp4 -movflags +frag_keyframe+empty_moov+default_base_moof pipe:1

However, there are problems in performance. After all, tcp needs multiple handshakes. The specific reason why UDP cannot be used is still being investigated.

Guess you like

Origin blog.csdn.net/Lemon_D1999/article/details/129534442