curl-library
RTSP
Date: Fri, 16 May 2014 19:34:25 -0700
Hello.
I am attempting to use the RTSP sample.
How would you record an RTSP stream to a server?
*/* send RTSP PLAY request */ **static* *void* *rtsp_play*(CURL *curl,
*const* *char* *uri, *const* *char* *range)
{
CURLcode res = CURLE_OK;
printf(*"\nRTSP: PLAY %s\n"*, uri);
my_curl_easy_setopt
<http://curl.haxx.se/libcurl/c/curl_easy_setopt.html>(curl,
CURLOPT_RTSP_STREAM_URI
<http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTRTSPSTREAMURI>,
uri);
my_curl_easy_setopt
<http://curl.haxx.se/libcurl/c/curl_easy_setopt.html>(curl,
CURLOPT_RANGE <http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTRANGE>,
range);
my_curl_easy_setopt
<http://curl.haxx.se/libcurl/c/curl_easy_setopt.html>(curl,
CURLOPT_RTSP_REQUEST
<http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTRTSPREQUEST>,
(*long*)CURL_RTSPREQ_PLAY);
my_curl_easy_perform
<http://curl.haxx.se/libcurl/c/curl_easy_perform.html>(curl);
}
This is a mock up of a record request. Given that we can se the rtsp
request options to record, we now need to attach the data and process
the request. How can i do this frame by frame?
*/* send RTSP RECORD request */ **static* *void* *rtsp_record*(CURL
*curl, *const* *char* *uri, *const* *char* *range)
{
CURLcode res = CURLE_OK;
printf(*"\nRTSP: PLAY %s\n"*, uri);
my_curl_easy_setopt
<http://curl.haxx.se/libcurl/c/curl_easy_setopt.html>(curl,
CURLOPT_RTSP_STREAM_URI
<http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTRTSPSTREAMURI>,
uri);
my_curl_easy_setopt
<http://curl.haxx.se/libcurl/c/curl_easy_setopt.html>(curl,
CURLOPT_RANGE <http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTRANGE>,
range);
my_curl_easy_setopt
<http://curl.haxx.se/libcurl/c/curl_easy_setopt.html>(curl,
CURLOPT_RTSP_REQUEST
<http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTRTSPREQUEST>,
(*long*)CURL_RTSPREQ_RECORD);
//SET THE DATA HERE
my_curl_easy_perform
<http://curl.haxx.se/libcurl/c/curl_easy_perform.html>(curl);
}
The other option is RTMP, however this is not very well understood.
Kind regards,
Daniel
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-05-17