<div dir="ltr"><div>  I don't know how to fix link confirmation error.   Thank you for any reply in advance.</div><div><br></div><div>1.  Following commands is working well.<br></div><div>$gst-launch-1.0 -v rtspsrc location=rtsp://<a href="http://admin:1q2w3e4r@192.168.0.18/TANK/media.smp">admin:1q2w3e4r@192.168.0.18/TANK/media.smp</a> !  rtpmp4vdepay ! decodebin ! autovideosink<br></div><div><br></div><div>2. I modified the sample code as followings but It doesn't work. The error was is 118,119 line number.</div><div><br></div><div><div>** (ex1:30254): WARNING **: Linking part (B) Fail...</div></div><div><br></div><div><div>  1 //Display RTSP streaming of video</div><div>  2  //(c) 2011 enthusiasticgeek</div><div>  3  // This code is distributed in the hope that it will be useful,</div><div>  4  // but WITHOUT ANY WARRANTY; without even the implied warranty of</div><div>  5  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  </div><div>  6 </div><div>  7 #include <string.h></div><div>  8 #include <math.h></div><div>  9 #include <gst/gst.h></div><div> 10 #include <glib.h></div><div> 11 </div><div> 12 static gboolean bus_call (GstBus *bus,GstMessage *msg, gpointer data){</div><div> 13   GMainLoop *loop = (GMainLoop *) data;</div><div> 14 </div><div> 15   switch (GST_MESSAGE_TYPE (msg)) {</div><div> 16 </div><div> 17     case GST_MESSAGE_EOS:</div><div> 18       g_printerr ("Stream Ends\n");</div><div> 19       g_main_loop_quit (loop);</div><div> 20       break;</div><div> 21 </div><div> 22     case GST_MESSAGE_ERROR: {</div><div> 23       gchar  *debug;</div><div> 24       GError *error;</div><div> 25 </div><div> 26       gst_message_parse_error (msg, &error, &debug);</div><div> 27       g_free (debug);</div><div> 28 </div><div> 29       g_printerr ("Error: %s\n", error->message);</div><div> 30       g_error_free (error);</div><div> 31 </div><div> 32       g_main_loop_quit (loop);</div><div> 33       break;</div><div> 34     }</div><div> 35     default:</div><div> 36       break;</div><div> 37   }</div><div> 38 </div><div> 39   return TRUE;</div><div> 40 }</div></div><div><div> 41 </div><div> 42 static void on_pad_added (GstElement *element, GstPad *pad, gpointer data){</div><div> 43 </div><div> 44   GstPad *sinkpad;</div><div> 45   GstElement *decoder = (GstElement *) data;</div><div> 46 </div><div> 47   /* We can now link this pad with the rtsp-decoder sink pad */</div><div> 48   g_print ("Dynamic pad created, linking source/demuxer\n");</div><div> 49 </div><div> 50   sinkpad = gst_element_get_static_pad (decoder, "sink");</div><div> 51 </div><div> 52   gst_pad_link (pad, sinkpad);</div><div> 53 </div><div> 54   gst_object_unref (sinkpad);</div><div> 55 }</div><div> 56 </div><div> 57 int main (int argc, char *argv[])</div><div> 58 {</div><div> 59   GMainLoop *loop;</div><div> 60   GstBus *bus;</div><div> 61   GstElement *source;</div><div> 62   GstElement *decoder;</div><div> 63   GstElement *sink;</div><div> 64   GstElement *pipeline;</div><div> 65   GstElement *demux;</div><div> 66   GstElement *colorspace;</div><div> 67 </div><div> 68   /* Initializing GStreamer */</div><div> 69   gst_init (&argc, &argv);</div><div> 70   loop = g_main_loop_new (NULL, FALSE);</div><div> 71 </div><div> 72  //gst-launch-0.10 rtspsrc location=rtsp://<ip> ! decodebin ! ffmpegcolorspace ! autovideosink</div><div> 73  //gst-launch -v rtspsrc location="rtsp://<ip> ! rtpmp4vdepay ! mpeg4videoparse ! ffdec_mpeg4 ! ffmpe    gcolorspace! autovideosink</div><div> 74  //gst-launch -v rtspsrc location="rtsp://<ip> ! rtpmp4vdepay ! ffdec_mpeg4 ! ffmpegcolorspace! autov    ideosink</div><div> 75 </div><div> 76   /* Create Pipe's Elements */</div><div> 77   pipeline = gst_pipeline_new ("video player");</div><div> 78   g_assert (pipeline);</div><div> 79   source   = gst_element_factory_make ("rtspsrc", "Source");</div><div> 80   g_assert (source);</div><div> 81 </div><div> 82   demux = gst_element_factory_make ("rtpmp4vdepay", "Depay");</div><div> 83   g_assert (demux);</div></div><div><div> 84   decoder = gst_element_factory_make ("decodebin", "Decoder");</div><div> 85   g_assert (decoder);</div><div> 86 </div><div> 87   sink     = gst_element_factory_make ("autovideosink", "Output");</div><div> 88   g_assert (sink);</div><div> 89 </div><div> 90   /*Make sure: Every elements was created ok*/</div><div> 91   if (!pipeline || !source || !demux || !decoder || !sink) {</div><div> 92     g_printerr ("One of the elements wasn't create... Exiting\n");</div><div> 93     return -1;</div><div> 94   }</div><div> 95 </div><div> 96   if (!pipeline || !source ) {</div><div> 97     g_printerr ("One of the elements wasn't create... Exiting\n");</div><div> 98     return -1;</div><div> 99   }</div><div>100 </div><div>101   g_printerr(" \nPipeline is Part(A) ->(dynamic/runtime link)  Part(B)[ Part(B-1) -> Part(B-2) -> Par    t(B-3) ]\n\n");</div><div>102   g_printerr(" [source](dynamic)->(dynamic)[demux]->[decoder]->[colorspace]->[videosink] \n\n");</div><div>103 </div><div>104   /* Set video Source */</div><div>105   g_printerr(" argv[1]=%s \n", argv[1]);</div><div>106   g_object_set (G_OBJECT (source), "location", argv[1], NULL);</div><div>107 </div><div>108 </div><div>109   /* Putting a Message handler */</div></div><div>110   bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br></div><div><div>111   gst_bus_add_watch (bus, bus_call, loop);</div><div>112   gst_object_unref (bus);</div><div>113 </div><div>114   /* Add Elements to the Bin */</div><div>115   gst_bin_add_many (GST_BIN (pipeline), demux, decoder, sink, NULL);</div><div>116 </div><div>117   /* Link confirmation */</div><div>118   if (gst_element_link_many (  demux, decoder,  sink, NULL)!=TRUE){</div><div>119       g_warning ("Linking part (B) Fail...");</div><div>120   }</div><div>121 </div><div>122 </div><div>123 </div><div>124   g_printerr("\nNote that the source will be linked to the demuxer(depayload) dynamically.\n\</div><div>125      The reason is that rtspsrc may contain various elements (for example\n\</div><div>126      audio and video). The source pad(s) will be created at run time,\n\</div><div>127      by the rtspsrc when it detects the amount and nature of elements.\n\</div><div>128      Therefore we connect a callback function which will be executed\n\</div><div>129      when the \"pad-added\" is emitted.\n");</div><div>130 </div><div>131   /* Dynamic Pad Creation */</div><div>132   if(! g_signal_connect (source, "pad-added", G_CALLBACK (on_pad_added),demux))</div><div>133   {</div><div>134     g_warning ("Linking part (A) with part (B) Fail... g_sinal_connect");</div><div>135 </div><div>136   }</div><div>137   /* Run the pipeline */</div><div>138   g_print ("Playing: %s\n", argv[1]);</div><div>139   gst_element_set_state (pipeline, GST_STATE_PLAYING);</div><div>140   g_main_loop_run (loop);</div><div>141 </div><div>142   /* Ending Playback */</div><div>143   g_print ("End of the Streaming... ending the playback\n");</div><div>144   gst_element_set_state (pipeline, GST_STATE_NULL);</div><div>145 </div><div>146   /* Eliminating Pipeline */</div><div>147   g_print ("Eliminating Pipeline\n");</div><div>148   gst_object_unref (GST_OBJECT (pipeline));</div><div>149 </div><div>150   return 0;</div><div>151 }</div></div><div>        -Its over-</div><div><br></div></div>