Could not link ffdemux_mpegts0 to videoqueue

gagankumarnigam gagankumarnigam at bel.co.in
Wed Apr 18 06:07:34 UTC 2018


Hi Tim,

I also added video pad with demuxer Still same issue could not link
mpegtsdemux0 with queue. 
Also replied in previous post if remove mpegtsdemux then code runs and
compile nicely with display nothing.
see my code given below i added pad .


#define VIDEO_CAPS
"application/x-rtp,media=video/mpegts,payload=(int)33,clock-rate=(int)90000,
encoding-name=MP2TS"
#define PORT 51000  
#define VIDEO_SINK  "xvimagesink
#define VIDEO_DEC  "ffdec_mpegvideo
pipeline = gst_pipeline_new (NULL);  
	g_assert (pipeline);
rtpsrc = gst_element_factory_make ("udpsrc", "rtpsrc");  
	g_assert (rtpsrc);
rtpbin = gst_element_factory_make ("gstrtpbin", "rtpbin");  
	g_assert (rtpbin);
g_object_set (rtpsrc, "port", PORT, NULL); 
caps = gst_caps_from_string (VIDEO_CAPS);  
	g_object_set (rtpsrc, "caps", caps, NULL);  
	gst_caps_unref (caps);  
gst_bin_add_many (GST_BIN (pipeline), rtpsrc, NULL); //Working only
	jitterbuffer = gst_element_factory_make
("gstrtpjitterbuffer","jitterbuffer");
  	g_assert (jitterbuffer); 
videodepay = gst_element_factory_make ("rtpmp2tdepay", "videodepay");
GstElement *demux = gst_element_factory_make ("mpegtsdemux", "mpegtsdemux");

	videoqueue=gst_element_factory_make ("queue","videoqueue");  
	g_assert(videoqueue);  
	GstElement *queue = gst_element_factory_make("queue", "q_tee1");
	g_assert(queue);
	tee = gst_element_factory_make ("tee","tee");  
	g_assert(tee);  
	aviqueue=gst_element_factory_make ("queue","aviqueue");  
	g_assert(aviqueue);  	 
	videoconv = gst_element_factory_make ("ffmpegcolorspace", "videoconv");  
	g_assert (videoconv);  	  
	videosink = gst_element_factory_make (VIDEO_SINK, "videosink");  
	g_assert (videosink);  

 g_object_set (G_OBJECT (videoqueue), "max-size-bytes", 10000, NULL);
  g_object_set (G_OBJECT (videoqueue), "max-size-buffers", 1000, NULL);
  g_object_set (G_OBJECT (videoqueue), "max-size-time", 500000, NULL);

gst_bin_add_many (GST_BIN
(pipeline),jitterbuffer,videodepay,tee,videoqueue,videodec,videoconv,videosink,NULL);
res1 = gst_element_link_many
(jitterbuffer,videodepay,demux,tee,videoqueue,videodec,videoconv,videosink,
NULL);
g_assert (res1 == TRUE);
g_object_set (G_OBJECT (videosink), "sync" , TRUE ,  NULL);
g_object_set (G_OBJECT (rtpbin),"latency",1000,NULL);  
g_object_set(G_OBJECT (jitterbuffer), "do-lost", true, NULL);   	
gst_bin_add (GST_BIN (pipeline), rtpbin); 
srcpad = gst_element_get_static_pad (rtpsrc, "src");  
sinkpad = gst_element_get_request_pad (rtpbin, "recv_rtp_sink_%d");  
lres = gst_pad_link (srcpad, sinkpad);  
g_assert (lres == GST_PAD_LINK_OK);  
gst_object_unref (srcpad);
g_signal_connect (rtpbin, "pad-added", G_CALLBACK
(pad_added_cb),jitterbuffer);  
g_print ("starting receiver pipeline\n");  
gst_element_set_state (pipeline, GST_STATE_PLAYING);  
loop = g_main_loop_new (NULL, FALSE);  
g_main_loop_run (loop);  	 
return 0;

}

static void  pad_added_cb (GstElement * rtpbin, GstPad * new_pad, GstElement
*jitterbuffer)  
{  
	GstPad *sinkpad;  
	GstPadLinkReturn lres;  
	g_print ("new payload on pad: %s\n", GST_PAD_NAME (new_pad)); 	  
  	sinkpad = gst_element_get_static_pad (jitterbuffer, "sink");  
	g_assert (sinkpad);  
	lres = gst_pad_link (new_pad, sinkpad);  
	gst_object_unref (sinkpad); 	
}  



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list