This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Gst-RTSP-Server Error



Hi,

My Requirement:
       
                     To serve an mp3 file  using gst-rtsp-0.10.2 .I'm using dvsdk_4_00_00_22.My DM365 board contains 64MB memory.
 
     What I did:
     
      The IP address of the server is set as 192.168.2.99 .Server listening port number is the default 8554.I edited the test-mp4.c example file from gst-rtsp server for executing this task.Compilation went without any issues.When I ran the binary, it said it was listening on 8554.So  the server was up and running.

    Result:
           
      I tried to receive the stream using VLC player. The uri used was rtsp://192.168.2.99:8554/test
      The connection was done.But then it said it failed to preroll the pipeline and exited.The DESCRIBE request failed saying the service was unavailable.

    Request: I'm attaching the code and the log along with this post.Please check them and point me the errors and changes to be done.Looking forward to replies

//*********************************************The Log******************************************************************************
root@dm365-evm:/opt# ./F0XX_004.o
** Message: listening on port 8554
** Message: added new client 0x58be90 ip 192.168.2.9:7940
** Message: attaching to context 0x58c200
RTSP request message 0x61d3c0
request line:
method: 'OPTIONS'
uri: 'rtsp://192.168.2.99:8554/test'
version: '1.0'
headers:
key: 'CSeq', value: '1'
key: 'User-Agent', value: 'VLC media player (LIVE555 Streaming Media v2009.04.20)'
body:
** Message: client 0x58be90: received a request
RTSP response message 0xbea51a7c
status line:
code: '200'
reason: 'OK'
version: '1.0'
headers:
key: 'CSeq', value: '1'
key: 'Public', value: 'OPTIONS, DESCRIBE, PAUSE, PLAY, SETUP, TEARDOWN'
key: 'Server', value: 'GStreamer RTSP server'
body: length 0
** Message: client 0x58be90: sent a message with cseq 1
RTSP request message 0x61d3c0
request line:
method: 'DESCRIBE'
uri: 'rtsp://192.168.2.99:8554/test'
version: '1.0'
headers:
key: 'CSeq', value: '2'
key: 'Accept', value: 'application/sdp'
key: 'User-Agent', value: 'VLC media player (LIVE555 Streaming Media v2009.04.20)'
body:
** Message: client 0x58be90: received a request
** Message: found media 0x5c1300 for url abspath /test
** Message: enter mainloop
** Message: constructed media 0x5c21b0 for url /test
** Message: preparing media 0x5c21b0

(:1336): GStreamer-WARNING **: failed to create thread: Error creating thread: Resource temporarily unavailable
** Message: 0x5c21b0: got message type stream-status

** (:1336): WARNING **: failed to preroll pipeline
** Message: 0x5c21b0: got message type stream-status
** Message: 0x5c21b0: got message type stream-status
RTSP response message 0xbea519f4
status line:
code: '503'
reason: 'Service Unavailable'
version: '1.0'
headers:
key: 'CSeq', value: '2'
key: 'Server', value: 'GStreamer RTSP server'
body: length 0
** Message: finalize media 0x5c21b0
** Message: 0x5c21b0: got message type stream-status
** Message: client 0x58be90: sent a message with cseq 2
** Message: client 0x58be90: connection closed
** Message: finalize client 0x58be90
** Message: added new client 0x64d490 ip 192.168.2.9:8708
** Message: attaching to context 0x58c200
RTSP request message 0x61d3a0
request line:
method: 'OPTIONS'
uri: 'rtsp://192.168.2.99:8554'
version: '1.0'
headers:
key: 'CSeq', value: '1'
key: 'User-Agent', value: 'RealMedia Player Version 6.0.9.1235 (linux-2.0-libc6-i386-gcc2.95)'
key: 'ClientChallenge', value: '9e26d33f2984236010ef6253fb1887f7'
key: 'PlayerStarttime', value: '[28/03/2003:22:50:23 00:00]'
key: 'CompanyID', value: 'KnKV4M4I/B2FjJ1TToLycw=='
key: 'GUID', value: '00000000-0000-0000-0000-000000000000'
key: 'RegionData', value: '0'
key: 'ClientID', value: 'Linux_2.4_6.0.9.1235_play32_RN01_EN_586'
body:
** Message: client 0x64d490: received a request
RTSP response message 0xbea51a7c
status line:
code: '200'
reason: 'OK'
version: '1.0'
headers:
key: 'CSeq', value: '1'
key: 'Public', value: 'OPTIONS, DESCRIBE, PAUSE, PLAY, SETUP, TEARDOWN'
key: 'Server', value: 'GStreamer RTSP server'
body: length 0
** Message: client 0x64d490: sent a message with cseq 1
** Message: client 0x64d490: connection closed
** Message: finalize client 0x64d490

//*********************************************The Code I used******************************************************************************

#include <gst/gst.h>

#include <gst/rtsp-server/rtsp-server.h>


static gboolean timeout (GstRTSPServer *server, gboolean ignored)
{
GstRTSPSessionPool *pool;

pool = gst_rtsp_server_get_session_pool (server);
gst_rtsp_session_pool_cleanup (pool);
g_object_unref (pool);

return TRUE;
}

int gstreamer_server_init(int argc, char *argv[])
{
GMainLoop *loop;
GstRTSPServer *server;
GstRTSPMediaMapping *mapping;
GstRTSPMediaFactory *factory;

gst_init (&argc, &argv);

loop = g_main_loop_new (NULL, FALSE);

/* create a server instance */
server = gst_rtsp_server_new ();

/* get the mapping for this server, every server has a default mapper object
* that be used to map uri mount points to media factories */
mapping = gst_rtsp_server_get_media_mapping (server);

/* make a media factory for a test stream. The default media factory can use
* gst-launch syntax to create pipelines.
* any launch line works as long as it contains elements named pay%d. Each
* element with pay%d names will be a stream */
factory = gst_rtsp_media_factory_new ();
gst_rtsp_media_factory_set_launch (factory, "( "
"filesrc location=test.mp3 ! "
"mp3parse ! rtpmpapay name=pay0 pt=96 "
")");

/* attach the test factory to the /test url */
gst_rtsp_media_mapping_add_factory (mapping, "/test", factory);

/* don't need the ref to the mapper anymore */
g_object_unref (mapping);

/* attach the server to the default maincontext */
gst_rtsp_server_attach (server, NULL);

g_timeout_add_seconds (2, (GSourceFunc) timeout, server);

/* start serving */
g_main_loop_run (loop);

return 0;
}