diff --git a/configure.ac b/configure.ac
index 082e3d6..dec5da0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,6 +226,7 @@ docs/version.entities
 m4/Makefile
 tests/Makefile
 tests/check/Makefile
+tests/examples/Makefile
 gnl/Makefile
 gnonlin.spec
 )
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ce326cf..29cf98a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,5 +1,5 @@
 if HAVE_CHECK
-SUBDIRS_CHECK = check
+SUBDIRS_CHECK = check examples
 else
 SUBDIRS_CHECK =
 endif
@@ -8,4 +8,5 @@ SUBDIRS = 			\
 	$(SUBDIRS_CHECK)
 
 DIST_SUBDIRS = 			\
-	check
+	check			\
+	examples
diff --git a/tests/examples/Makefile.am b/tests/examples/Makefile.am
new file mode 100644
index 0000000..923e7ec
--- /dev/null
+++ b/tests/examples/Makefile.am
@@ -0,0 +1,8 @@
+# makefile for examples
+
+bin_PROGRAMS = gstextractor
+gstextractor_SOURCES = gstextractor.c
+gstextractor_CFLAGS = $(GST_CFLAGS)
+gstextractor_LDADD = $(GST_LIBS)
+gstextractor_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+gstextractor_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
diff --git a/tests/examples/gstextractor.c b/tests/examples/gstextractor.c
new file mode 100644
index 0000000..0929465
--- /dev/null
+++ b/tests/examples/gstextractor.c
@@ -0,0 +1,359 @@
+/* Gnonlin
+ * Copyright (C) <2014> Raman Mohan <mohan43u@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * pipeline: gnlcomposition. (                                  \
+ *                gnlsource. (                                  \
+ *                     bin. (                                   \
+ *                          filesrc ! decodebin                 \
+ *                     )                                        \
+ *                ),                                            \
+ *                gnlsource. (                                  \
+ *                     bin. (                                   \
+ *                          filesrc ! decodebin                 \
+ *                     )                                        \
+ *                ),                                            \
+ *                ...                                           \
+ *           ) ! audioconvert ! faac ! qtmux ! filesink         \
+ *           gnlcomposition. (                                  \
+ *                gnlsource. (                                  \
+ *                     bin. (                                   \
+ *                          filesrc ! decodebin                 \
+ *                     )                                        \
+ *                ),                                            \
+ *                gnlsource. (                                  \
+ *                     bin. (                                   \
+ *                          filesrc ! decodebin                 \
+ *                     )                                        \
+ *                ),                                            \
+ *               ...                                            \
+ *           ) ! videoconvert ! x264enc ! qtmux0.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <glib-unix.h>
+#include <gst/gst.h>
+
+typedef struct
+{
+  GstElement *linkelement;
+  GstElement *bin;
+} GstExtractorCallbackArgs;
+
+typedef struct
+{
+  GstElement *audiocomp;
+  GstElement *audioconvert;
+  GstElement *audioenc;
+  GstElement *mux;
+  GstElement *out;
+  GstElement *videocomp;
+  GstElement *videoconvert;
+  GstElement *videoenc;
+} GstExtractorElements;
+
+typedef struct
+{
+  GstExtractorElements *elements;
+  GstElement *pipeline;
+  GMainLoop *mainloop;
+  GstBus *msgbus;
+} GstExtractor;
+
+/*
+ * gstextractor_timestamp_to_nanoseconds:
+ * @timestamp: time string in [hh:[mm:]]ss format
+ *
+ * function to convert time into nanoseconds
+ *
+ * Returns: nanoseconds calculated from @timestmap string
+ */
+
+static guint64
+gstextractor_timestamp_to_nanoseconds (gchar * timestamp)
+{
+  gchar **timev = g_strsplit (timestamp, ":", -1);
+  gint timec = g_strv_length (timev);
+  gdouble time = 0;
+
+  time = time + ((timec - 1) >= 0
+      && timev[timec - 1] ? g_strtod (timev[timec - 1], NULL) : 0);
+  time = time + ((timec - 2) >= 0
+      && timev[timec - 2] ? g_strtod (timev[timec - 2], NULL) * 60 : 0);
+  time = time + ((timec - 3) >= 0
+      && timev[timec - 3] ? g_strtod (timev[timec - 3], NULL) * 60 * 60 : 0);
+
+  g_strfreev (timev);
+  return (guint64) (time * GST_SECOND);
+}
+
+/*
+ * gstextractor_no_more_pads_cb:
+ * @element: element which generated no-more-pads signal
+ * @data: GstElement* which points to @linkelement
+ *
+ * this callback links @element with @linkelement after pads created
+ * in @element
+ */
+
+static void
+gstextractor_no_more_pads_cb (GstElement * element, gpointer data)
+{
+  GstElement *linkelement = (GstElement *) data;
+  if (!gst_element_link (element, linkelement)) {
+    g_printerr ("element->linkelement not linked\n");
+  }
+}
+
+/*
+ * gstextractor_pad_added_cb:
+ * @element: element which generated pad-added signal
+ * @pad: pad which got created dynamically
+ * @data: GstExtractorCallbackArgs* which contains @bin and @linkelement
+ *
+ * this callback adds ghostpads into @bin compatable with @linkelement
+ */
+
+static void
+gstextractor_pad_added_cb (GstElement * element, GstPad * pad, gpointer data)
+{
+  GstExtractorCallbackArgs *args = (GstExtractorCallbackArgs *) data;
+  if (gst_caps_is_always_compatible (gst_pad_query_caps (pad, NULL),
+          gst_pad_query_caps (gst_element_get_static_pad (args->linkelement,
+                  "sink"), NULL))) {
+    GstPad *gpad = gst_ghost_pad_new (NULL, pad);
+    gst_pad_set_active (gpad, TRUE);
+    gst_element_add_pad (args->bin, gpad);
+  }
+}
+
+/*
+ * gstextractor_gen_comp:
+ * @this: GstExtractor* object
+ * @linkelement: element which need to be linked after dynamic pads creation
+ * @filesinfo: delemited string contains list of filename:start:stop information
+ *
+ * for each filename:start:stop information, this function will create
+ * two gnlsource elements (one for audio track and another for video track) and
+ * then add them into gnlcomposition element. Finally, that gnlcomposition will
+ * be returned to plug-it into gstreamer's pipeline.
+ *
+ * Returns: (transfer full) : gnlcomposition element
+ */
+
+static GstElement *
+gstextractor_gen_comp (GstExtractor * this, GstElement * linkelement,
+    gchar * filesinfo)
+{
+  GstElement *comp = gst_element_factory_make ("gnlcomposition", NULL);
+  gchar **filesv = g_strsplit (filesinfo, ",", -1);
+  gint filesc = g_strv_length (filesv);
+  gint i = 0;
+  guint64 offset = 0;
+  gboolean ret = TRUE;
+
+  for (; i < filesc; i++) {
+    gchar **detailsv = g_strsplit (filesv[i], "|", -1);
+    GstElement *in = gst_element_factory_make ("filesrc", NULL);
+    GstElement *decode = gst_element_factory_make ("decodebin", NULL);
+    char *binname = g_strdup_printf ("bin%d", i);
+    GstElement *bin = gst_bin_new (binname);
+    GstElement *source = gst_element_factory_make ("gnlsource", NULL);
+    GstExtractorCallbackArgs *args = g_new (GstExtractorCallbackArgs, 1);
+    guint64 start = offset;
+    guint64 inpoint = gstextractor_timestamp_to_nanoseconds (detailsv[1]);
+    guint64 duration =
+        gstextractor_timestamp_to_nanoseconds (detailsv[2]) - inpoint;
+
+    gst_bin_add (GST_BIN (comp), source);
+    gst_bin_add (GST_BIN (source), bin);
+    gst_bin_add_many (GST_BIN (bin), in, decode, NULL);
+
+    gst_element_link (in, decode);
+    args->linkelement = linkelement;
+    args->bin = bin;
+    g_signal_connect (decode,
+        "pad-added", G_CALLBACK (gstextractor_pad_added_cb), args);
+
+    g_object_set (in, "location", detailsv[0], NULL);
+    g_object_set (source, "start", start, NULL);
+    g_object_set (source, "inpoint", inpoint, NULL);
+    g_object_set (source, "duration", duration, NULL);
+    g_object_set (source, "priority", 1, NULL);
+    offset += duration;
+
+    g_strfreev (detailsv);
+    g_free (binname);
+  }
+
+  g_signal_connect (comp,
+      "no-more-pads", G_CALLBACK (gstextractor_no_more_pads_cb), linkelement);
+  g_signal_emit_by_name (comp, "commit", TRUE, &ret);
+
+  g_strfreev (filesv);
+  return comp;
+}
+
+/*
+ * gstextractor_elements_init:
+ * @this: GstExtractor* object
+ * @filesinfo: contains list of filename:start:stop information
+ * @outfile: output filename
+ *
+ * generates elements and initialized them.
+ */
+
+static void
+gstextractor_elements_init (GstExtractor * this, gchar * filesinfo,
+    gchar * outfile)
+{
+  this->elements = g_new (GstExtractorElements, 1);
+  this->elements->audioconvert =
+      gst_element_factory_make ("audioconvert", NULL);
+  this->elements->audioenc = gst_element_factory_make ("faac", NULL);
+  this->elements->mux = gst_element_factory_make ("qtmux", NULL);
+  this->elements->out = gst_element_factory_make ("filesink", NULL);
+  this->elements->videoconvert =
+      gst_element_factory_make ("videoconvert", NULL);
+  this->elements->videoenc = gst_element_factory_make ("x264enc", NULL);
+
+  this->elements->audiocomp =
+      gstextractor_gen_comp (this, this->elements->audioconvert, filesinfo);
+  this->elements->videocomp =
+      gstextractor_gen_comp (this, this->elements->videoconvert, filesinfo);
+
+  gst_bin_add_many (GST_BIN (this->pipeline),
+      this->elements->audiocomp,
+      this->elements->audioconvert,
+      this->elements->audioenc,
+      this->elements->mux,
+      this->elements->out,
+      this->elements->videocomp,
+      this->elements->videoconvert, this->elements->videoenc, NULL);
+
+  gst_element_link_many (this->elements->audioconvert,
+      this->elements->audioenc, this->elements->mux, this->elements->out, NULL);
+
+  gst_element_link_many (this->elements->videoconvert,
+      this->elements->videoenc, this->elements->mux, NULL);
+
+  g_object_set (this->elements->out, "location", outfile, NULL);
+}
+
+/*
+ * gstextractor_run:
+ * @this: GstExtractor* object
+ *
+ * starts pipeline and mainloop
+ *
+ */
+
+static void
+gstextractor_run (GstExtractor * this)
+{
+  gst_element_set_state (this->pipeline, GST_STATE_PLAYING);
+  g_main_loop_run (this->mainloop);
+}
+
+/*
+ * gstextractor_run:
+ * @this: GstExtractor* object
+ *
+ * stops pipeline and mainloop
+ *
+ */
+
+static void
+gstextractor_stop (GstExtractor * this)
+{
+  gst_element_set_state (this->pipeline, GST_STATE_NULL);
+  g_main_loop_quit (this->mainloop);
+}
+
+/*
+ * gstextractor_msgbus_cb:
+ * @bus: pipeline message bus
+ * @message: GstMessage coming from various elements in pipeline
+ * @data: contsins GstExtractor* object
+ *
+ * prints various messages coming from elements in pipeline.
+ *
+ */
+
+static gboolean
+gstextractor_msgbus_cb (GstBus * bus, GstMessage * message, gpointer * data)
+{
+  GstExtractor *this = (GstExtractor *) data;
+  switch (GST_MESSAGE_TYPE (message)) {
+    case (GST_MESSAGE_EOS):
+      gstextractor_stop (this);
+      break;
+    case (GST_MESSAGE_STATE_CHANGED):{
+      GstState old;
+      GstState new;
+      gst_message_parse_state_changed (message, &old, &new, NULL);
+      g_printerr ("%d: state changed from %s to %s on %s\n",
+          GST_MESSAGE_SEQNUM (message),
+          gst_element_state_get_name (old),
+          gst_element_state_get_name (new), GST_MESSAGE_SRC_NAME (message));
+    }
+      break;
+    default:
+      g_printerr ("%d: received %s from %s..\n",
+          GST_MESSAGE_SEQNUM (message),
+          GST_MESSAGE_TYPE_NAME (message), GST_MESSAGE_SRC_NAME (message));
+  }
+  return TRUE;
+}
+
+/*
+ * gstextractor_init:
+ * @this: GstExtractor* object
+ * @fileinfo: delemeted string contains list of  filename:start:stop information
+ * @outfile: output filename
+ */
+
+static void
+gstextractor_init (GstExtractor * this, gchar * filesinfo, gchar * outfile)
+{
+  if (!gst_is_initialized ())
+    gst_init (NULL, NULL);
+  this->mainloop = g_main_loop_new (NULL, FALSE);
+  this->pipeline = gst_pipeline_new ("pipeline0");
+  gstextractor_elements_init (this, filesinfo, outfile);
+  this->msgbus = gst_element_get_bus (GST_ELEMENT (this->pipeline));
+  gst_bus_add_watch_full (this->msgbus,
+      G_PRIORITY_DEFAULT, (GstBusFunc) gstextractor_msgbus_cb, this, NULL);
+}
+
+int
+main (int argc, char *argv[])
+{
+  GstExtractor gstextractor;
+
+  if (argc < 3) {
+    g_printerr
+        ("[usage] %s \"file|start([hh:mm:]ss)|stop([hh:mm:]ss)[,...]\" outfile\n",
+        argv[0]);
+    exit (EXIT_FAILURE);
+  }
+
+  gstextractor_init (&gstextractor, argv[1], argv[2]);
+  gstextractor_run (&gstextractor);
+  return 0;
+}
