[gst-devel] Can't play video well using gstreamer

Honolulu Honolulu1986 at gmail.com
Tue Nov 24 03:15:36 CET 2009


Hi, all
I have a pipeline . I use ximagesink for display. 
It works fine in gst-launch..---->: 
gst-launch-0.10 filesrc location=/home/lvwenwen/princess.avi ! decodebin !
Xvimagesink 

but when I run the C program that looks like this :

int main(int argc,char *argv[])
{
    GMainLoop *loop;
    GstElement *pipeline,*source,*parser,*decoder,*con,*sink;
    GstBus *bus;
    char *path="/home/lvwenwen/princess.avi";

    gst_init(&argc,&argv);

    loop = g_main_loop_new(NULL,FALSE);

    pipeline=gst_pipeline_new("avi");
    source=gst_element_factory_make("filesrc","file-source");
    decoder=gst_element_factory_make("decodebin","decoder");
    sink=gst_element_factory_make("xvimagesink","file-output");

    if(!pipeline || !source || !decoder || !sink){
       g_print("One element could not be created\n");
       return -1;
    }

    g_object_set(G_OBJECT(source),"location",path,NULL);
    gst_bin_add_many(GST_BIN(pipeline),source,decoder,sink,NULL);
    gst_element_link_many(source,decoder,sink,NULL);
   

    gst_element_set_state(pipeline,GST_STATE_PLAYING);
  

    g_main_loop_run(loop);

    return 0;
}

When I try to run this, it does not show the video image output. There is
just no response. What may be the issue ?


Any help will be useful. 

Thanks & Best regards,

Honolulu
-- 
View this message in context: http://old.nabble.com/Can%27t-play-video-well-using-gstreamer-tp26489499p26489499.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.





More information about the gstreamer-devel mailing list