rtspsrc: SETUP generates 400 Bad Request
Describe your issue
Gstreamer generates 400 Bad Request in the lastest main HEAD a8387fdc from sep 17 when requesting an RTSP stream from an IP cam:
rtspsrc user-id=admin user-pw=admin location=rtsp://192.168.110.40 ! decodebin ! videoconvert name=videoconvert qos=false ! video/x-raw,format=RGB ! appsink name=sclbl_gst_appsink max-buffers=4 wait_on_eos=false drop=true async=false sync=false
In our previous application using the aug 13 (commit a13fd0ea) the IP cam stream could still be parsed.
The 400 Bad request also happens in 1.20.3.1. So the issue may concern a backported commit.
Expected Behavior
SETUP gives rise to 200 OK: (log)
``` 0:00:00.914662105 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2235:gst_rtspsrc_collect_payloads: mapping sdp session level attributes to caps 0:00:00.914778825 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2237:gst_rtspsrc_collect_payloads: mapping sdp media level attributes to caps 0:00:00.915014870 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2255:gst_rtspsrc_collect_payloads: looking at 0 pt: 26 0:00:00.915269040 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2394:gst_rtspsrc_create_stream: stream 0, (0x7f87affdd0) 0:00:00.915320447 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2395:gst_rtspsrc_create_stream: port: 0 0:00:00.915398209 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2396:gst_rtspsrc_create_stream: container: 0 0:00:00.915451543 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2397:gst_rtspsrc_create_stream: control: trackID=0 0:00:00.915500346 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2451:gst_rtspsrc_create_stream: setup: rtsp://192.168.110.40/0/trackID=0 0:00:00.915554305 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:539:default_select_stream: default handler 0:00:00.915581805 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:550:select_stream_accum: accum 1 0:00:00.915622847 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:7477:gst_rtspsrc_setup_streams_start: doing setup of stream 0x7f87affdd0 with rtsp://192.168.110.40/0/trackID=0 0:00:00.915659827 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:7492:gst_rtspsrc_setup_streams_start: protocols = 0x7, protocol mask = 0x1 0:00:00.915693734 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:6957:gst_rtspsrc_create_transports_string: got transports (NULL) 0:00:00.915736703 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:6987:gst_rtspsrc_create_transports_string: adding UDP unicast 0:00:00.915773787 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:7014:gst_rtspsrc_create_transports_string: prepared transports RTP/AVP;unicast;client_port=%%u1-%%u2 0:00:00.915823579 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:7508:gst_rtspsrc_setup_streams_start: replace ports in RTP/AVP;unicast;client_port=%%u1-%%u2 0:00:00.916900469 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2651:gst_rtspsrc_alloc_udp_ports: got RTP port 53919 0:00:00.916962710 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2659:gst_rtspsrc_alloc_udp_ports: RTP port not even 0:00:00.917011617 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2661:gst_rtspsrc_alloc_udp_ports: free RTP udpsrc 0:00:00.917210526 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2666:gst_rtspsrc_alloc_udp_ports: retry 1 0:00:00.917696209 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2651:gst_rtspsrc_alloc_udp_ports: got RTP port 53920 0:00:00.918068767 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:2683:gst_rtspsrc_alloc_udp_ports: starting RTCP on port 53921 0:00:00.918221998 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:7519:gst_rtspsrc_setup_streams_start: transport is now RTP/AVP;unicast;client_port=53920-53921 0:00:00.918289707 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:560:default_before_send: default handler 0:00:00.918337625 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:6612:gst_rtspsrc_try_send: sending message 0:00:00.918371531 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9837:gst_rtspsrc_print_rtsp_message: -------------------------------------------- 0:00:00.918427886 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9840:gst_rtspsrc_print_rtsp_message: RTSP request message 0x7f8745d558 0:00:00.918472053 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9841:gst_rtspsrc_print_rtsp_message: request line: 0:00:00.918516846 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9842:gst_rtspsrc_print_rtsp_message: method: 'SETUP' 0:00:00.918560492 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9844:gst_rtspsrc_print_rtsp_message: uri: 'rtsp://192.168.110.40/0/trackID=0' 0:00:00.918610753 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9845:gst_rtspsrc_print_rtsp_message: version: '1.0' 0:00:00.918654244 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9847:gst_rtspsrc_print_rtsp_message: headers: 0:00:00.918695963 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9820:dump_key_value: key: 'User-Agent', value: 'GStreamer/1.21.0.1' 0:00:00.918730182 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9820:dump_key_value: key: 'Transport', value: 'RTP/AVP;unicast;client_port=53920-53921' 0:00:00.918771849 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9849:gst_rtspsrc_print_rtsp_message: body: 0:00:00.918802787 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9929:gst_rtspsrc_print_rtsp_message: -------------------------------------------- 0:00:00.920445622 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9837:gst_rtspsrc_print_rtsp_message: -------------------------------------------- 0:00:00.920487602 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9859:gst_rtspsrc_print_rtsp_message: RTSP response message 0x7f8745d5b0 0:00:00.920531405 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9860:gst_rtspsrc_print_rtsp_message: status line: 0:00:00.920566197 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9861:gst_rtspsrc_print_rtsp_message: code: '200' 0:00:00.920605000 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9862:gst_rtspsrc_print_rtsp_message: reason: 'OK' 0:00:00.920644063 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9863:gst_rtspsrc_print_rtsp_message: version: '1.0 0:00:00.920694168 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9865:gst_rtspsrc_print_rtsp_message: headers: 0:00:00.920740054 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9820:dump_key_value: key: 'CSeq', value: '4' 0:00:00.920796982 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9820:dump_key_value: key: 'Server', value: 'Rtsp Server' 0:00:00.920843441 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9820:dump_key_value: key: 'Session', value: '13692250' 0:00:00.920902139 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9820:dump_key_value: key: 'Transport', value: 'RTP/AVP;unicast;client_port=53920-53921;source=192.168.110.40;server_port=32769-32770;ssrc=A046' 0:00:00.920943911 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9868:gst_rtspsrc_print_rtsp_message: body: length 0 0:00:00.920997088 26464 0x7f87f28a40 LOG rtspsrc gstrtspsrc.c:9929:gst_rtspsrc_print_rtsp_message: -------------------------------------------- 0:00:00.921043912 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:6514:gst_rtsp_src_receive_response: received response message 0:00:00.921175060 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:6533:gst_rtsp_src_receive_response: got response message 200 0:00:00.921226779 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:7231:gst_rtsp_src_setup_stream_from_response: stream 0x7f87affdd0 as UDP unicast 0:00:00.921262561 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:4802:gst_rtspsrc_stream_configure_transport: configuring transport for stream 0x7f87affdd0 0:00:00.921299332 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:4811:gst_rtspsrc_stream_configure_transport: setting media type to application/x-rtp 0:00:00.921339802 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:4033:gst_rtspsrc_stream_configure_manager: using manager rtpbin 0:00:00.921541159 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:3740:set_manager_buffer_mode: auto buffering mode, have clock (NULL) 0:00:00.921583034 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:3761:set_manager_buffer_mode: auto buffering mode 0:00:00.921620378 26464 0x7f87f28a40 DEBUG rtspsrc gstrtspsrc.c:3766:set_manager_buffer_mode: selected slave ```Observed Behavior
SETUP gives rise to 400 Bad Request: (log)
``` 0:00:00.937989782 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2235:gst_rtspsrc_collect_payloads: mapping sdp session level attributes to caps 0:00:00.938056554 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2237:gst_rtspsrc_collect_payloads: mapping sdp media level attributes to caps 0:00:00.938179680 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2255:gst_rtspsrc_collect_payloads: looking at 0 pt: 26 0:00:00.938385829 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2394:gst_rtspsrc_create_stream: stream 0, (0x7faced1ab0) 0:00:00.938430830 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2395:gst_rtspsrc_create_stream: port: 0 0:00:00.938458747 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2396:gst_rtspsrc_create_stream: container: 0 0:00:00.938502393 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2397:gst_rtspsrc_create_stream: control: trackID=0 0:00:00.938591092 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2423:gst_rtspsrc_create_stream: setup: rtsp://192.168.110.40/trackID=0 0:00:00.938638541 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:539:default_select_stream: default handler 0:00:00.938667239 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:550:select_stream_accum: accum 1 0:00:00.938709740 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:7449:gst_rtspsrc_setup_streams_start: doing setup of stream 0x7faced1ab0 with rtsp://192.168.110.40/trackID=0 0:00:00.938752605 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:7464:gst_rtspsrc_setup_streams_start: protocols = 0x7, protocol mask = 0x1 0:00:00.938789429 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:6929:gst_rtspsrc_create_transports_string: got transports (NULL) 0:00:00.938905576 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:6959:gst_rtspsrc_create_transports_string: adding UDP unicast 0:00:00.938943337 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:6986:gst_rtspsrc_create_transports_string: prepared transports RTP/AVP;unicast;client_port=%%u1-%%u2 0:00:00.938987817 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:7480:gst_rtspsrc_setup_streams_start: replace ports in RTP/AVP;unicast;client_port=%%u1-%%u2 0:00:00.940068457 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2623:gst_rtspsrc_alloc_udp_ports: got RTP port 42041 0:00:00.940121739 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2631:gst_rtspsrc_alloc_udp_ports: RTP port not even 0:00:00.940153667 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2633:gst_rtspsrc_alloc_udp_ports: free RTP udpsrc 0:00:00.940289033 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2638:gst_rtspsrc_alloc_udp_ports: retry 1 0:00:00.940978679 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2623:gst_rtspsrc_alloc_udp_ports: got RTP port 42042 0:00:00.941551187 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:2655:gst_rtspsrc_alloc_udp_ports: starting RTCP on port 42043 0:00:00.941732908 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:7491:gst_rtspsrc_setup_streams_start: transport is now RTP/AVP;unicast;client_port=42042-42043 0:00:00.941810149 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:560:default_before_send: default handler 0:00:00.941860827 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:6584:gst_rtspsrc_try_send: sending message 0:00:00.941891140 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9809:gst_rtspsrc_print_rtsp_message: -------------------------------------------- 0:00:00.941932547 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9812:gst_rtspsrc_print_rtsp_message: RTSP request message 0x7fac82f548 0:00:00.941974683 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9813:gst_rtspsrc_print_rtsp_message: request line: 0:00:00.942020152 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9814:gst_rtspsrc_print_rtsp_message: method: 'SETUP' 0:00:00.942052236 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9816:gst_rtspsrc_print_rtsp_message: uri: 'rtsp://192.168.110.40/trackID=0' 0:00:00.942086090 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9817:gst_rtspsrc_print_rtsp_message: version: '1.0' 0:00:00.942142550 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9819:gst_rtspsrc_print_rtsp_message: headers: 0:00:00.942183123 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9792:dump_key_value: key: 'User-Agent', value: 'GStreamer/1.21.0.1' 0:00:00.942235051 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9792:dump_key_value: key: 'Transport', value: 'RTP/AVP;unicast;client_port=42042-42043' 0:00:00.942269062 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9821:gst_rtspsrc_print_rtsp_message: body: 0:00:00.942305052 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9901:gst_rtspsrc_print_rtsp_message: -------------------------------------------- 0:00:00.944968632 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9809:gst_rtspsrc_print_rtsp_message: -------------------------------------------- 0:00:00.945019205 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9831:gst_rtspsrc_print_rtsp_message: RTSP response message 0x7fac82f5a0 0:00:00.945051341 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9832:gst_rtspsrc_print_rtsp_message: status line: 0:00:00.945132332 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9833:gst_rtspsrc_print_rtsp_message: code: '400' 0:00:00.945194677 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9834:gst_rtspsrc_print_rtsp_message: reason: 'Bad Request' 0:00:00.945233479 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9835:gst_rtspsrc_print_rtsp_message: version: '1.0 0:00:00.945278636 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9837:gst_rtspsrc_print_rtsp_message: headers: 0:00:00.945316657 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9792:dump_key_value: key: 'CSeq', value: '4' 0:00:00.945366033 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9792:dump_key_value: key: 'Server', value: 'Rtsp Server' 0:00:00.945404732 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9840:gst_rtspsrc_print_rtsp_message: body: length 0 0:00:00.945461347 26531 0x7fad2fda40 LOG rtspsrc gstrtspsrc.c:9901:gst_rtspsrc_print_rtsp_message: -------------------------------------------- 0:00:00.945503379 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:6486:gst_rtsp_src_receive_response: received response message 0:00:00.945572130 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:6505:gst_rtsp_src_receive_response: got response message 400 0:00:00.945641662 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:4238:gst_rtspsrc_stream_free_udp: free UDP source 0 for stream 0x7faced1ab0 0:00:00.945788435 26531 0x7fad2fda40 DEBUG rtspsrc gstrtspsrc.c:4238:gst_rtspsrc_stream_free_udp: free UDP source 1 for stream 0x7faced1ab0 0:00:00.946000834 26531 0x7fad2fda40 WARN rtspsrc gstrtspsrc.c:7674:gst_rtspsrc_setup_streams_start: error: Error (400): Bad Request ```Setup
- Ubuntu 18.04
- Computer
- main
How reproducible is the bug?
The reproducibility of the bug is Always
(edited to add collapsible sections to hide log output, tpm)