Question regarding gst_parse_launch function

philippe renon philippe_renon at
Wed Nov 29 07:42:17 UTC 2017

The -e option is valid when using gst-launch from the command line.Remove it from your pipeline as it is causing the syntax error.

    Le Mercredi 29 novembre 2017 2h08, qjqj <quanjie at> a écrit :


I tried both with -e and without -e, the error I got was this:

[gstreamer] initialized gstreamer, version
[gstreamer] gstreamer decoder failed to create pipeline
[gstreamer]    (syntax error)
[gstreamer] failed to init gstCamera

gst-camera:  failed to initialize video device

Which is from parser, and here is my source code:

bool gstCamera::buildLaunchStr()
    std::ostringstream ss;
    //open ip camera
    ss << " udpsrc port=15004 !";
    ss << " application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay !
h264parse !"; 
    ss << " queue ! avdec_h264 ! xvimagesink sync=false async=false -e";
    mLaunchStr = ss.str();

    printf(LOG_GSTREAMER "gstreamer decoder pipeline string:\n");
    printf("%s\n", mLaunchStr.c_str());
    return true;

bool gstCamera::init()
    GError* err = NULL;

    // build pipeline string
    if( !buildLaunchStr() )
        printf(LOG_GSTREAMER "gstreamer decoder failed to build pipeline
        return false;

    // launch pipeline
    mPipeline = gst_parse_launch(mLaunchStr.c_str(), &err);

    if( err != NULL )
        printf(LOG_GSTREAMER "gstreamer decoder failed to create pipeline\n");
        printf(LOG_GSTREAMER "  (%s)\n", err->message);
        return false;

    // get the appsrc
    GstElement* appsinkElement = gst_bin_get_by_name(GST_BIN(pipeline),
    GstAppSink* appsink = GST_APP_SINK(appsinkElement);

    if( !appsinkElement || !appsink)
        printf(LOG_GSTREAMER "gstreamer failed to retrieve AppSink element from
        return false;
    mAppSink = appsink;
    // setup callbacks
    GstAppSinkCallbacks cb;
    memset(&cb, 0, sizeof(GstAppSinkCallbacks));
    cb.eos        = onEOS;
    cb.new_preroll = onPreroll;
    cb.new_sample  = onBuffer;
    gst_app_sink_set_callbacks(mAppSink, &cb, (void*)this, NULL);
    return true;

Sent from:
gstreamer-devel mailing list
gstreamer-devel at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list