rtsp server from android to pc

yoyosuper8 yoyosuper8 at yahoo.com
Mon Oct 7 14:01:35 PDT 2013


Ok, never mind. I had some extra additional code that was causing the hang
up. The code below will work and will allow you to create an rtsp server on
your android device and using vlc on a computer, you can view the
videotestsrc streaming like magic :)

	  /* Declarations */
	  GMainLoop *loop;
	  GstRTSPServer *server;
	  GstRTSPMediaMapping *mapping;
	  GstRTSPMediaFactory *factory;


	  /* Set debugging level */
	  gst_debug_set_default_threshold(3);

	  loop = g_main_loop_new (NULL, FALSE);
	  server = gst_rtsp_server_new ();

	  /* Specify the IP address of the android device. This is the wifi ip
address. */
	  gst_rtsp_server_set_address(server, "192.168.1.84");
	  /* Specify the port number */
	  gst_rtsp_server_set_service(server, "10000");

	  mapping = gst_rtsp_server_get_media_mapping (server);
	  factory = gst_rtsp_media_factory_new ();
	  gst_rtsp_media_factory_set_launch (factory,
	    "( videotestsrc is-live=1 ! x264enc ! rtph264pay send-config=true
name=pay0 pt=96 )");

	  /* Debug rtph264pay */
	  gst_debug_set_threshold_for_name("rtph264pay", 3);

	  gst_rtsp_media_factory_set_shared (factory, TRUE);
	  gst_rtsp_media_mapping_add_factory (mapping, "/test", factory);
	  g_object_unref (mapping);
	  if (gst_rtsp_server_attach (server, NULL) == 0) {
		  GST_ERROR("FAILED TO ATTACH THE SERVER");
	  }

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


Please try this out and post your success.
Andy



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/rtsp-server-from-android-to-pc-tp4662269p4662425.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list