GNOME Bugzilla – Bug 608417
rtspsrc problem with \n and \r as first line
Last modified: 2010-02-12 11:26:13 UTC
Created attachment 152552 [details] wireshark dump that demostrate the problem I have some strange problem with an rtsp stream, attacched is a dump with wireshark for the following pipeline: gst-launch rtspsrc debug=true location=rtsp://192.168.2.24/media/video1 ! decodebin ! autovideosink the pipeline exit with this error: gstrtspsrc.c(3766): gst_rtspsrc_try_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not receive message. (Parse error)
Created attachment 152553 [details] vlc can see the stream with no problem here is the wireshark dump
It seems it's because of the Data header that is in french: 0090 69 6f 6e 3a 20 32 34 0d 0a 44 61 74 65 3a 20 76 ion: 24. .Date: v 00a0 65 6e 2c 20 32 39 20 67 65 6e 20 32 30 31 30 20 en, 29 g en 2010 00b0 30 38 3a 30 35 3a 33 36 20 47 4d 54 0d 0a 0d 0a 08:05:36 GMT....
hmm, sorry. maybe not
It's the reply from the SETUP request that has 2 extra bytes (\r\n), they should not be there.
Hi Wim, do you plan to release a workaround (maybe an additional property for rtspsrc)? If no can you point me towards the code I have to modify? thanks Nicola
Created attachment 152559 [details] [review] rtsp: ignore empty first lines When we get a request or response from a server, ignore empty lines before the response or request status lines. Fixes #608417
Please try attached patch and let me know if it works.
No Wim, it doesn't work, I added an addtional g_print: if (empty && builder->line == 0) { g_print("empy\n\n\n\n\n"); break; } and it is never printed, (g_print before and after the above code works) Nicola
Can you apply this patch and paste the output here? diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 9300532..1a4bb16 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -1893,6 +1893,8 @@ build_next (GstRTSPBuilder * builder, GstRTSPMessage * message, if (res != GST_RTSP_OK) goto done; + gst_util_dump_mem (builder->buffer, builder->offset); + /* check for empty line */ empty = builder->buffer[0] == '\0';
Created attachment 152566 [details] there an additional g_print("builder line valore %d\n",builder->line); from my previous attempt
Created attachment 152586 [details] [review] possible patch The server is still quite broken but attached patch at least makes rtspsrc connect properly. The next thing is that this server is always sending an RTP timestamp of 0...
Thanks now if works! What kind of problem I can have with RTP timestamp of 0? Probably I cannot use the gstrtpjitterbuffer, other problems?. I'll ping sony for this problem. Do you think \r\n fix will go in the next gstreamer release? I think will be useful for other people too.
(In reply to comment #12) > Thanks now if works! What kind of problem I can have with RTP timestamp of 0? > Probably I cannot use the gstrtpjitterbuffer, other problems?. I'll ping sony > for this problem. GStreamer does not increment timestamps in this case and frames are dropped. I'm going to try to work around this. > > Do you think \r\n fix will go in the next gstreamer release? I think will be > useful for other people too. Surely.
The RTP timestamp problems only seem to happen in TCP mode.
commit 30fd219e6367d413eb22961ad9a94ca74d286e8e Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Fri Jan 29 16:34:44 2010 +0100 rtsp: ignore \n and \r as the first line Be more forgiving for bad servers and ignore \r and \n when we are looking for the response/request line. See #608417