Segmentation fault, when setting ffenc_mpeg2video

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Segmentation fault, when setting ffenc_mpeg2video

pavel
Hello,
please help to resolve the following problem:

I'm using gstreamer 0.10,

In this example source: http://pastebin.com/jhSCuCbF
at the line #135 I'm getting the segmentation fault while trying to modify settings of the created ffenc_mpeg2video object.

When I'm trying to access, for example, queue from the same chain, no error happened.
Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault, when setting ffenc_mpeg2video

pavel
Also,

Quite strange, that I cannot configure another ffenc_mpeg2video object at runtime:
Here, I just replace modifying of the encoder object from the chain, by creating another encoder object, and configuring it.
The execution crashes at first call to g_object_set

#if 0
    encoder = gst_bin_get_by_name (GST_BIN (data->pipeline), "encoder_hq");
    if (encoder == NULL)
    {
        printf("%s-%d: Object \"encoder_hq\" could not be accessed.\n", __func__, __LINE__);
        return -1;
    }
    printf("%s-%d: Object \"encoder_hq\" instantiated.\n", __func__, __LINE__);
    g_object_set (encoder, "quantizer", 1, "gop-size", 15, (char *)NULL);
    printf("%s-%d: Object \"encoder_lq\" Configured\n", __func__, __LINE__);
#else

    encoder = gst_element_factory_make("ffenc_mpeg2video", "encoder_lq");
    if (!encoder)
    {
        g_printerr ("%s-%d: Object \"encoder_lq\" could not be created.\n", __func__, __LINE__);
        return -1;
    }
    printf("%s-%d: Object \"encoder_lq\" Created\n", __func__, __LINE__);
    g_object_set (G_OBJECT(encoder), "quantizer", 1, (char *)NULL);
    g_object_set (G_OBJECT(encoder), "gop-size", 15, (char *)NULL);
    printf("%s-%d: Object \"encoder_lq\" Configured\n", __func__, __LINE__);

    gst_element_set_state(encoder, GST_STATE_READY);
    gst_bin_add(GST_BIN(data->pipeline), encoder);
#endif
Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault, when setting ffenc_mpeg2video

harishjennykn
Typecast it to float
        g_object_set (G_OBJECT(encoder), "quantizer", (float)1, (char *)NULL);

Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault, when setting ffenc_mpeg2video

Sebastian Dröge-3
On Mo, 2013-10-21 at 03:46 -0700, harishjennykn wrote:
> Typecast it to float
>         g_object_set (G_OBJECT(encoder), "quantizer", (float)1, (char
> *)NULL);

And if it is still a problem, try if you can reproduce it with a recent
1.x version of GStreamer and provide a backtrace :)

--
Sebastian Dröge <[hidden email]>
Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (985 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault, when setting ffenc_mpeg2video

pavel
No problem with that, Than you for the fix.