v4l2src rtsp streaming connect error
JongIlLee
lji890214 at naver.com
Wed Jul 13 07:32:28 UTC 2016
hi~~
I am using a notebook (ubuntu 14.04), using the v4l2src element and rtsp
server,
It succeeded in real-time image reproduction.
But here there is a problem.
Only one client can be connected.
During the client connects to the server, other clients access impossible.
The following error is output.
Multiple clients are designed to be connected .....
I really do not help me
------------------------------------------------------------------------------------------------------------
Impossible to access client error:
[0x7f7ab4000ed8] live555 demux error: Failed to connect with rtsp: //
LocalIP: 8554 / test
[0x7f7abc0009b8] main input error: open of `rtsp: // LocalIP: 8554 / test
'failed
------------------------------------------------------------------------------------------------------------
server error:
libv4l2: error setting pixformat: Device or resource busy
------------------------------------------------------------------------------------------------------------
here is my c program code:
----------------------------------------------------------------------------
#include <gst/gst.h>
#include <gst/rtsp-server/rtsp-server.h>
#undef WITH_AUTH
static gboolean
timeout (GstRTSPServer * server, gboolean ignored)
{
//g_print("server 2second timeout \n");
GstRTSPSessionPool *pool;
pool = gst_rtsp_server_get_session_pool (server);
gst_rtsp_session_pool_cleanup (pool);
g_object_unref (pool);
return TRUE;
}
int main (int argc, char *argv[]){
g_print("main start\n");
GMainLoop *loop;
GstRTSPServer *server;
GstRTSPMountPoints *mount;
GstRTSPMediaFactory *factory;
#ifdef WITH_AUTH
GstRTSPAuth *auth;
gchar *basic;
#endif
gst_init (&argc, &argv);
loop = g_main_loop_new (NULL, FALSE);
server = gst_rtsp_server_new ();
mount = gst_rtsp_server_get_mount_points(server);
auth = gst_rtsp_auth_new ();
basic = gst_rtsp_auth_make_basic ("user", "admin");
gst_rtsp_auth_set_basic (auth, basic);
g_free (basic);
gst_rtsp_server_set_auth (server, auth);
#endif
factory = gst_rtsp_media_factory_new ();
gst_rtsp_media_factory_set_launch (factory, "( "
"v4l2src device=/dev/video0 !
video/x-raw,width=1280,height=720,framerate=30/1 ! x264enc ! queue !
rtph264pay name=pay0 pt=96 ! audiotestsrc ! audio/x-raw,rate=8000 ! alawenc
! rtppcmapay name=pay1 pt=97 "")");
gst_rtsp_mount_points_add_factory (mount, "/test", factory);
g_print("media add factory success \n");
g_object_unref (mount);
if (gst_rtsp_server_attach (server, NULL) == 0)
goto failed;
g_timeout_add_seconds (2, (GSourceFunc) timeout, server);
g_print("main end\n");
g_main_loop_run (loop);
return 0;
failed:
{
g_print ("failed to attach the server\n");
return -1;
}
}
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/v4l2src-rtsp-streaming-connect-error-tp4678656.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list