Crash when trying to stop pipeline containing encodebin

Michael Guinzbourg mguinzbourg at gmail.com
Wed May 11 06:19:53 UTC 2016


here's the piece of my code which builds the pipeline:

 gst_bin_add_many (GST_BIN (pipeline), data.source, data.q,data.convert,
data.filter, ebin, data.q1, data.sink, NULL);
  if (!gst_element_link_many (data.q, data.convert, data.filter, ebin,
data.q1, data.sink, NULL)) {
    g_printerr ("Elements could not be linked.\n");
    gst_object_unref (pipeline);
    return -1;
  }

on padd added signal callback I link data.source and data.q.
My source is a live video stream which plays chunks of video and ends every
5 sec. at the EOS event I try to restart pipeline so I can play the next
chunk. If I encode in H264 this works perfect. If I encode in mpeg2 it
crashes at the following line (in bold):

          case GST_MESSAGE_EOS:
                    g_print("EOS received on OBJ NAME
%s\n",GST_OBJECT_NAME(msg->src));
*gst_element_set_state (pipeline, GST_STATE_READY);*
            gst_element_set_state (pipeline, GST_STATE_PLAYING);
                    break;

encode element doesn't print any debug info after pipeline starts running,
just crashes with no cry for help at *gst_element_set_state (pipeline,
GST_STATE_READY);*

On 11 May 2016 at 02:09, Sebastian Dröge <sebastian at centricular.com> wrote:

> On Mi, 2016-05-11 at 02:07 -0400, Michael Guinzbourg wrote:
> > I've set GST_DEBUG to "encodebin:6". I've got all kinds of all good
> > info during encodebin initialization (I will copy it below my
> > report). All the debug messages were posted before pipeline started
> > to run and there was absolutely nothing until the sudden crash at the
> > bold line in my code below. The piece of code that produces the crash
> > is here (in the bus callback):
> >
> >  case GST_MESSAGE_EOS:
> >                     g_print("EOS received on OBJ NAME
> > %s\n",GST_OBJECT_NAME(msg->src));
> >                   gst_element_set_state (pipeline, GST_STATE_READY);
> >                   gst_element_set_state (pipeline,
> > GST_STATE_PLAYING);
> >                     break;
> >
> > If I change my encoding to H264 - this code runs normally and restart
> > the pipeline without any problem.
> > Below is the debug output - there's nothing at all after the pipeline
> > starts running.
> >
> > Again, if I replace gst_element_set_state (pipeline,
> > GST_STATE_READY); line with gst_element_set_state (<element_name>,
> > GST_STATE_READY); where <element_name> is any element except for
> > encodebin then gstreamer doesn't crash. It only crashes when I
> > command the pipeline or encodebin to stop. It looks to me that
> > gstreamer crashes when I try to bring encodebin to the stopped state,
> > which is something to do with inability to sync the encodebin clock
> > with the rest of the pipeline.
> > Below is the copy of the debug output.
>
> Can you get a backtrace (of all threads) of the crash with gdb?
>
> It's a bit curious that you don't get any further debug output. Can you
> also share your code, or simplified code that reproduces the problem?
>
> --
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160511/f41ebc32/attachment.html>


More information about the gstreamer-devel mailing list