stream video for a certain period

Krishnan krishnan.saravanak at
Fri Jul 15 14:46:37 PDT 2011

Hi Vineeth,

Thank you so much for the reply. I used the timeout function as you had
suggested and it came out of the loop. But, the problem I am facing right
now is that the server keeps holding the camera and hence I cannot access
the camera again. So, I tried different functions to shutdown the server,
clean the pipelines. But it didn't help. The following part of code would
give you an idea of what I am trying to do...

        id = gst_rtsp_server_attach (server, NULL);
        // start serving
	g_timeout_add_seconds (10 , timeout_callback , loop); 
	gboolean SHUTDOWN = FALSE;
	gboolean VALUE=TRUE;
	printf(" Is factory shutdown? = %s\n", (SHUTDOWN)?"true":"false"); 
	gst_rtsp_media_factory_set_eos_shutdown (factory,VALUE);
	SHUTDOWN = gst_rtsp_media_factory_is_eos_shutdown(factory);
	printf(" Is factory shutdown? = %s\n", (SHUTDOWN)?"true":"false");
	int remove=0;
	printf("\nRemove = %d", remove);
	remove = g_source_remove (id);
	printf("\nRemove = %d", remove);
	g_object_unref (server);
	g_main_loop_unref (loop);

I got the values of SHUTDOWN and remove as 1(which shows that the media
factory is cleaned up and source is removed). Still, it failed to release
the camera and when it loops to next iteration, I get the following error,

VIDIOC_S_FMT: Device or resource busy

This basically happens because the camera is held by rtsp-server and hence I
cannot initialize the camera again (I have to intialize the camera again to
switch between diff cameras). 

Can you recommend which function I can use to free everything that
rtsp-server uses, so that I can able to access the camera?


View this message in context:
Sent from the GStreamer-devel mailing list archive at

More information about the gstreamer-devel mailing list