[gst-devel] ffdec_mpeg4 win32gst problem

Riccardo Corona coronariccardo at gmail.com
Mon May 14 17:30:24 CEST 2007


Hi,
I'm developing a gst-app with MFC: I'm currently trying to show an mpeg4
stream with gst.
I'm using the windows gst one from http://perso.orange.es/moutte983/gstreamer/
.
My goal is to use a fakesrc in which getting mpeg4 packet (done) and show
with gst the video but I get this message: "ffdec_mpeg4:input format was not
set before data start ".
Here's my gst core:

.....

GstElement *pipeline, *fakesrc, *flt, *conv,
*videosink,*decoder,*videoscale,*par;
    GstBus* bus;
    GMainLoop *loop;

    /* init GStreamer */
    gst_init (NULL,NULL);
    loop = g_main_loop_new (NULL, FALSE);

    pipeline = gst_pipeline_new ("pipeline");
    fakesrc = gst_element_factory_make ("fakesrc", "source");
    decoder = gst_element_factory_make ("ffdec_mpeg4","mpeg4-decoder");
    videoscale = gst_element_factory_make ("videoscale", "scaling-video");
    par = gst_element_factory_make ("capsfilter", "dimens");

    g_object_set (G_OBJECT(par), "caps",
      gst_caps_new_simple( "video/x-raw-yuv",
        "width", G_TYPE_INT, 720,
        "height", G_TYPE_INT, 576,NULL),
      NULL );

    conv = gst_element_factory_make ("ffmpegcolorspace", "converter");
    videosink = gst_element_factory_make ("directdrawsink", "directdraw");
    if (!pipeline || !fakesrc || !decoder || !videoscale || !par || !conv ||
!videosink) {
        g_print ("One element could not be created\n");
        return -1;
    }

    /* put all elements in a bin */
    gst_bin_add_many (GST_BIN (pipeline),
            fakesrc, decoder,videoscale ,par, conv, videosink, NULL);

    /* link together */
    gst_element_link_many (fakesrc,decoder,videoscale, par, conv, videosink,
NULL);


    bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
    gst_bus_add_watch (bus, bus_call, loop);
    gst_object_unref (bus);

    g_object_set (G_OBJECT (fakesrc),
        "signal-handoffs", TRUE,
        "sizemax", 720 * 288 * 2,
        "sizetype", 2, NULL);

    g_signal_connect (fakesrc, "handoff", G_CALLBACK (cb_handoff), pParam);


    /* Now set to playing and iterate. */
    gst_element_set_state (pipeline, GST_STATE_PLAYING);
    g_main_loop_run (loop);

    /* clean up nicely */
    gst_element_set_state (pipeline, GST_STATE_NULL);
    gst_object_unref (GST_OBJECT (pipeline));

    return 0;
}

...


The mpeg4 stream is via tcp but I can't use tcp plugin with gstwin32 (I
can't find it!), so I must use the callback.

Thank's.
-- 
Riccardo Corona
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20070514/e2ff5a18/attachment.htm>


More information about the gstreamer-devel mailing list