[gst-devel] Need help for rezising video.

Nicolas c.r.n.a at wanadoo.fr
Wed Jan 5 19:50:02 CET 2011


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.




More information about the gstreamer-devel mailing list