[gst-devel] Need help for rezising video.

Timothy Braun braunsquared at gmail.com
Wed Jan 5 20:06:55 CET 2011


You always want to check the return result from any of the link calls.
Also, to link the decodebin you have to listen for the pad-added (or is it
new-decoded-pad, I can't recall) and link when it's available.  It won't be
available until the decodebin has setup the decoders and such.

-Tim

On Wed, Jan 5, 2011 at 1:50 PM, Nicolas <c.r.n.a at wanadoo.fr> wrote:

> Hi,
>
> In fact, i made a new pipeline just for testing and my problem is, i
> don't know what to link together !
> In the code below nothing append, no message (gst-launch sample work
> perfectly).
>
> #include <gst/gst.h>
>
> // Build with gcc test.c `pkg-config --cflags --libs gstreamer-0.10
> glib-2.0` -o test
> // gst-launch filesrc location="/home/niko/jour1.avi" ! decodebin !
> videoscale ! capsfilter
> caps=video/x-raw-yuv,width=800,height=600,framerate=30/1 !
> ffmpegcolorspace ! ximagesink
>
> int
> main (int   argc,
>       char *argv[])
> {
>   GMainLoop *loop;
>   GstElement *pipeline, *source, *decode, *scale, *filter, *color, *sink;
>   GstCaps *caps;
>
>   gst_init (&argc, &argv);
>   loop = g_main_loop_new (NULL, FALSE);
>
>
>   pipeline = gst_pipeline_new ("test_pipeline");
>
>   source = gst_element_factory_make ("filesrc", "source");
>   g_object_set ((GObject*) source, "location", "/home/niko/jour1.avi",
> NULL);
>
>   decode = gst_element_factory_make ("decodebin", "decode");
>   scale = gst_element_factory_make ("videoscale", "scale");
>
>   filter = gst_element_factory_make ("capsfilter", "filter");
>   caps = gst_caps_new_simple ("video/x-raw-yuv", "format",
> GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), "width",
> G_TYPE_INT, 800, "height", G_TYPE_INT, 600, "framerate",
> GST_TYPE_FRACTION, 30, 1, NULL);
>   g_object_set ((GObject*) filter, "caps", caps, NULL);
>   gst_caps_unref(caps);
>
>   color = gst_element_factory_make ("ffmpegcolorspace", "color");
>   sink = gst_element_factory_make ("ximagesink", "output");
>
>   gst_bin_add_many (GST_BIN (pipeline), source, scale, filter, color,
> sink, NULL);
>
>   gst_element_link_many(source, scale, filter, color, sink, NULL);
>
>   gst_element_set_state (pipeline, GST_STATE_PLAYING);
>
>    g_main_loop_run (loop);
>
>   gst_element_set_state (pipeline, GST_STATE_NULL);
>   gst_object_unref (GST_OBJECT (pipeline));
>   return 0;
> }
>
> Thanks in advance for you help.
> Nicolas.
>
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment,
> and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110105/ab105163/attachment.htm>


More information about the gstreamer-devel mailing list