cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl not receiving rtsp data

From: Jim Hollinger <hollinger.jim_at_gmail.com>
Date: Mon, 11 Jul 2011 08:51:15 -0400

The 'transport' string in the RTSP SETUP request specifies the port to which
the server will stream data. For example, the following transport string
will cause the server to stream RTP data to UDP port 1234 on the client and
listen for RTCP status on UDP port 1235:

RTP/AVP;unicast;client_port=1234-1235

I believe the CURLOPT_WRITEFUNCTION will only receive data on the open rtsp
connection - this is typically TCP port 554 on the server and automatic on
the client. Thus I would not expect any RTP video to be received by
the CURLOPT_WRITEFUNCTION.
Instead you would need to open and read from the appropriate UDP port (1234
in the example above) outside of cURL. I would need to see the RTSP request
and response transactions to make a better guess.

On Mon, Jul 11, 2011 at 5:48 AM, Michael Dale <michaeld_at_bbvcctv.com> wrote:

> ** **
>
> Hello,****
>
> ** **
>
> I am currently working on an rtsp client application on an
> embedded system and have been trying to use libcurl version 7.21.7.****
>
> ** **
>
> The problem that I have is that whilst I can receive the
> options, describe, setup and teardown responses I cannot receive any data
> packets even though they are clearly being sent from the server (captured in
> wireshark). Am I correct in saying that once the following sequence has been
> sent data should arrive in the desired function ‘rtsp_write’ or am I missing
> something critical. ****
>
> ** **
>
> curl_easy_set_opt(curl, CURLOPT_NOPROGRESS, 1L);****
>
> curl_easy_set_opt(curl, CURLOPT_VERBOSE, 1L);****
>
> curl_easy_set_opt(curl, CURLOPT_URL, url);****
>
> curl_easy_set_opt(curl, CURLOPT_WRITEHEADDER, stdout);****
>
> ** **
>
> // options****
>
> curl_easy_set_opt(curl, CURLOPT_RTSP_STREAM_URI, uri);****
>
> curl_easy_set_opt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);****
>
> curl_easy_perform(curl);****
>
> ** **
>
> // describe****
>
> curl_easy_set_opt(curl, CURLOPT_WRITEDATA, sdp);****
>
> curl_easy_set_opt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_DESCRIBE);****
>
> curl_easy_perform(curl);****
>
> curl_easy_set_opt(curl, CURLOPT_WRITEDATA, stdout);****
>
> ** **
>
> // setup the stream****
>
> curl_easy_set_opt(curl, CURLOPT_RTSP_STREAM_URI, uri);****
>
> curl_easy_set_opt(curl, CURLOPT_RTSP_TRANSPORT, transport);****
>
> curl_easy_set_opt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP);****
>
> curl_easy_perform(curl);****
>
> ** **
>
> // play the stream****
>
> curl_easy_set_opt(curl, CURLOPT_RTSP_STREAM_URI, uri);****
>
> curl_easy_set_opt(curl, CURLOPT_RTSP_RANGE, NULL);****
>
> curl_easy_set_opt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_PLAY);****
>
> curl_easy_perform(curl);****
>
> ** **
>
> // setup receive function for data****
>
> curl_easy_set_opt(curl, CURLOPT_WRITEFUNCTION, rtsp_write);****
>
> curl_easy_set_opt(curl, CURLOPT_WRITEDATA, NULL);****
>
> ** **
>
> // process loop ****
>
> while(!ctx->terminate)****
>
> {****
>
> SDL_Delay(10);****
>
> }****
>
> ** **
>
> // end stream****
>
> curl_easy_set_opt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_TEARDOWN);****
>
> curl_easy_perform(curl);****
>
> ** **
>
> ** **
>
> Kind Regards****
>
> **Michael Dale******
>
> Building Block Video Ltd
> 17 Apex Park
> Hailsham
> **********East Sussex**********,
> BN27 3JU
> ********************England************************
>
> Tel:+44(0)1323 842727
> Fax:+44(0)1323 842728****
>
> mailto:michaeld_at_bbvcctv.com <michaeld_at_bbvcctv.com>****
>
> Any emails from me, and any attached files, are intended only for the
> person, persons, entity, or entities to which they are addressed; they may
> contain confidential and/or privileged materials, which should not be
> retransmitted or otherwise disseminated.
> If you receive an email from me in error, please let me know, and delete
> the material from your computer.****
>
> ** **
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 6283 (20110711) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-07-11