473,789 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

server client connection set up for streaming

2 New Member
I am trying to set up a server client network .Server will be able to stream live audio captured from a radio receiver connected to its line in port to multiple clients over the network.

Gstreamer is used for setting up the RTSP(Real Time Streaming Protocol) based server.And at the client side i used VLC Media player to open the input network stream by specifying the IP adress & default port no of server.

C code which i used for setting up the streaming server goes like:
Expand|Select|Wrap|Line Numbers
  1. #include <gst/gst.h>
  2. #include <gst/rtsp-server/rtsp-server.h>
  3.  
  4. /* define this if you want the resource to only be available when using
  5. * user/admin as the password */
  6.  
  7. #undef WITH_AUTH
  8.  
  9. /* this timeout is periodically run to clean up the expired sessions from the
  10.  * pool. This needs to be run explicitly currently but might be done
  11. * automatically as part of the mainloop. */
  12.  
  13. static gboolean
  14.  
  15. timeout (GstRTSPServer * server, gboolean ignored)
  16. {
  17.   GstRTSPSessionPool *pool;
  18.  
  19.   pool = gst_rtsp_server_get_session_pool (server);
  20.  
  21.   gst_rtsp_session_pool_cleanup (pool);
  22.  
  23.   g_object_unref (pool)
  24.  
  25.   return TRUE;
  26. }
  27.  
  28. Int
  29.  
  30. main (int argc, char *argv[])
  31.  
  32. {
  33.  
  34.   GMainLoop *loop;
  35.  
  36.   GstRTSPServer *server;
  37.  
  38.   GstRTSPMediaMapping *mapping;
  39.  
  40.   GstRTSPMediaFactory *factory;
  41.  
  42. #ifdef WITH_AUTH
  43.  
  44.   GstRTSPAuth *auth;
  45.  
  46.   gchar *basic;
  47.  
  48. #endif
  49.  
  50.   gst_init (&argc, &argv);
  51.  
  52.   loop = g_main_loop_new (NULL, FALSE);
  53.  
  54.   /* create a server instance */
  55.  
  56.   server = gst_rtsp_server_new ();
  57.  
  58.   /* get the mapping for this server, every server has a default mapper object
  59.   * that be used to map uri mount points to media factories */
  60.  
  61.   mapping = gst_rtsp_server_get_media_mapping (server);
  62.  
  63. #ifdef WITH_AUTH
  64.  
  65.   /* make a new authentication manager. it can be added to control access to all
  66.  * the factories on the server or on individual factories. */
  67.  
  68.   auth = gst_rtsp_auth_new ();
  69.  
  70.   basic = gst_rtsp_auth_make_basic ("user", "admin");
  71.  
  72.   gst_rtsp_auth_set_basic (auth, basic); 
  73.  
  74.   g_free (basic);
  75.  
  76.   /* configure in the server */
  77.  
  78.   gst_rtsp_server_set_auth (server, auth);
  79.  
  80. #endif
  81.  
  82.   /* make a media factory for a test stream. The default media factory can use
  83.  
  84.    * gst-launch syntax to create pipelines. 
  85.  
  86.    * any launch line works as long as it contains    elements named pay%d. Each
  87.  
  88.    * element with pay%d names will be a stream */
  89.  
  90.   factory = gst_rtsp_media_factory_new ();
  91.  
  92.   gst_rtsp_media_factory_set_launch (factory, "( "
  93.  
  94.       "videotestsrc ! video/x-raw-yuv,width=352,height=288,framerate=15/1 ! "
  95.  
  96.       "x264enc ! rtph264pay name=pay0 pt=96 "
  97.  
  98.       "audiotestsrc ! audio/x-raw-int,rate=8000 ! "
  99.  
  100.       "alawenc ! rtppcmapay name=pay1 pt=97 " ")");
  101.  
  102.  
  103.   /* attach the test factory to the /test url */
  104.  
  105.   gst_rtsp_media_mapping_add_factory (mapping, "/test", factory);
  106.  
  107.   /* don't need the ref to the mapper anymore */
  108.  
  109.   g_object_unref (mapping);
  110.  
  111.   /* attach the server to the default maincontext */
  112.  
  113.   if (gst_rtsp_server_attach (server, NULL) == 0)
  114.  
  115.     goto failed;
  116.  
  117.   /* add a timeout for the session cleanup */
  118.  
  119.   g_timeout_add_seconds (2, (GSourceFunc) timeout, server);
  120.  
  121.   /* start serving, this never stops */
  122.  
  123.   g_main_loop_run (loop);
  124.  
  125.   return 0;
  126.  
  127.   /* ERRORS */
  128.  
  129. failed:
  130.   {
  131.  
  132.     g_print ("failed to attach the server\n");
  133.  
  134.     return -1;
  135.  
  136.   }
  137.  
When tested with local host my client VLC was able to open the input stream successfully..a nd it did work well

But when tried with SERVER and CLIENT on different machines ,vlc displayed the following message:

connection was not established
VLC unable to open the MRL

I dont know why it is not working when tried with server and client on different machines.Help me answer these questions as i need to demonstrate streaming between a server and client computer by connecting using a LAN cable,as a part of my project .

1)Is this a connection failure? if yes ,how can i solve it?
actually i established the connection using a LAN CABLE ,and proxy was set on both sides identifiying one as server and other as client.

2)Do i need to modify the code?

3)Where do you think the problem is ? client side or server side?

Please some one help me with this........as i need to complete this project by next week
Apr 13 '11 #1
3 4515
sicarie
4,677 Recognized Expert Moderator Specialist
Can you ping the proxy? Can you simulate the connection from both the client and the server - ensuring information can travel both ways?
Apr 15 '11 #2
supriya prasad
2 New Member
ya,when i ping the proxy,it show that a connection exists,but when i try to open the input stream using vlc at the client side,it says that the connection is not being established
Apr 26 '11 #3
sicarie
4,677 Recognized Expert Moderator Specialist
A ping wouldn't show a connection exists - it shows a path exists. Connections are usually shown through netstat output.

So both client/server can ping the proxy? Are there intermediate nodes?

Have you attempted to telnet to the ports that are expected on both the proxy and client/server? That will show that the ports are open and listening for the program to make a connection
May 2 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2322
by: Michael Goettsche | last post by:
Hi there, I'm trying to write a simple server/client example. The client should be able to send text to the server and the server should distribute the text to all connected clients. However, it seems that only the first entered text is sent and received. When I then get prompted for input again and press return, nothing gets back to me. Any hints on what I have done would be very much appreciated! Here's my code:
3
2488
by: MBW | last post by:
The following code is for a simple server/client asplication that allows the user to toggle between serve and or client modes and send/recieve a message however i am getting an Attribute error on my entry widgets when I try and call get() to get the port and ip address from those fields, I'm sure it's something simple I haven't grasped... #START from Tkinter import * from socket import *
2
1723
by: Prabhat | last post by:
Hi All, How can we fine if the SQL Server Client is Installed in the System or Not. (Using VB and/or Delphi) As My EXE Require SQL Server Client to Work so I have to Check that If the Client is Installed or not? Please Suggest How Can I find If SQL Server 2000 Client IS Installed or NOT Using VB / VB.NET / Delphi. Please Help.
0
1053
by: savia755 | last post by:
I created 2 forms, one I put in Apache to be called by another after I click a button on it. But whenever I call the application, I get a socket exception message that I can initialize only one port+ip at a time on the client form. On server side, I use 0 as a parameter for the connections to be free (any IP addresses are accepted). When I click the close button on either one of the forms, the whole application crashes. i am sorry I don't...
3
3567
by: pvrsatya | last post by:
hi all i am using TCP/Ip i am running server application in one PC client application in other PC i am connecting these thro PC's in LAN If i remove the LAN cable
4
2428
by: lightyagami | last post by:
how to connect 2 pc in sql server,1 is server and 1 is client...? and also my question is,is it ok if the server runs in windows xp?or we need a windows NT? pls help me with my thesis...Thanks
0
1515
by: 85ssp | last post by:
I am creating a small server client program that is meant for up to 70 connections from 70 different computers on a network. Everything in the program functions correctly except when testing operations with a server crash, the clients go into a disconnected state and wait for the server to come back up. Once the server is up the clients attept to connect. 75% of the time all clients connect and there connect message is accepted and...
3
3491
by: dynamo08 | last post by:
Hi, I am new to socket programming, I wrote an ftpclient which connects to an ftp server and downloads a file to the client computer. Now in one client connection I want to download multiple files by forking the parent connection. So far I have this, the code downloads only one file, and then gives the following error "Transfer Completed425 Unable to build data connection: Invalid argument" Appreciate if someone can help me here. The...
3
7205
by: Hukkky | last post by:
I'm testing simple server/client codes on linux. just server can wait for client's connect sign and accept, and client can't connect to server, this is all. There's no problems just for this objects. I'm testing for the situation.. after the connection between server and client is done, if server or client hits the "ctrl+c" key. The problem is either case for server or for client hits the "ctrl +c"key, they goes infinite loop. I...
0
2647
by: ryaneoghan | last post by:
hi, I was just wondering if anyone could help, i am trying to create a client and server socket connection in perl, i want to ask for name and then do a check on the name and ask for a secret word if it does not match, i have this much done but dont know where to go from here and cant find anything to help on net, if you could help using the code i have done i would be grateful, thanks! here is the 2 files #!/usr/bin/perl -w #...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.