[gst-devel] Need help for rezising video.
Vincent Torri
vtorri at univ-evry.fr
Wed Jan 5 20:09:04 CET 2011
On Wed, 5 Jan 2011, Nicolas 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);
strangely, there is no 'decode' element here :)
Vincent
>
> 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
>
>
More information about the gstreamer-devel
mailing list