<div dir="ltr"><div>Continuing to dig deeper, I have tracked down another location where it is hanging which might be the culprit. <br><br>        self.pipeline_front.get_state(Gst.CLOCK_TIME_NONE)[0]<br>        self.elements['innersink'].send_event(Gst.Event.new_step(Gst.Format.BUFFERS, 1, 1, True, False))<br>        self.inner_sample = self.elements['innersink'].emit('pull-preroll')<br>        self.inner_buffer = self.inner_sample.get_buffer()<br>        self.elements['innersrc'].set_property('caps', self.inner_sample.get_caps())<br>        self.elements['innersrc'].emit('push-buffer', self.inner_buffer)<br><br>        self.raw_sample = self.elements['rawsink'].emit('pull-preroll')  <-------------------- Hangs on this statement<br>        self.raw_buffer = self.raw_sample.get_buffer()<br><br>        if (self.pipeline_front.get_state(Gst.CLOCK_TIME_NONE)[0] != Gst.StateChangeReturn.SUCCESS):<br>            LOG.warn('Pipeline did not get a success status: {0}'.format(self.pipeline_front.get_state(Gst.CLOCK_TIME_NONE)))<br><br></div>Is there a way to make sure the buffer has been pushed so that I can preroll it on the 2nd pipeline? I'm not sure why but the pull preroll occasionally gets stuck. The odd thing is that if I run the file by itself it does not get stuck and continues to process correctly. If I run multiiple files in parallel a few end up sometimes getting stuck here.<br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 8, 2016 at 11:45 AM, Brian Panneton <span dir="ltr"><<a href="mailto:brian.panneton@gmail.com" target="_blank">brian.panneton@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>It is actually a combination of 3 manually connected pipelines:<br><br>        self.elements = {}<br>        self.elements['filesrc'] = Gst.ElementFactory.make('files<wbr>rc')<br>        self.elements['filesrc'].set_p<wbr>roperty('location', self.filename)<br>        self.elements['matroskademux'] = Gst.ElementFactory.make('matro<wbr>skademux')<br>        self.elements['matroskademux']<wbr>.connect('pad-added', self.demuxer_callback)<br>        self.elements['h264parse'] = Gst.ElementFactory.make('h264p<wbr>arse')<br>        self.elements['raw1queue'] = Gst.ElementFactory.make('queue<wbr>')<br>        self.elements['innersink'] = Gst.ElementFactory.make('appsi<wbr>nk')<br><br>        self.elements['innersrc'] = Gst.ElementFactory.make('appsr<wbr>c')<span class=""><br>        self.elements['avdec_h264'] = Gst.ElementFactory.make('avdec<wbr>_h264')<br></span>        self.elements['videoconvert'] = Gst.ElementFactory.make('video<wbr>convert')<br>        self.elements['capsfilter'] = Gst.ElementFactory.make('capsf<wbr>ilter')<br>        self.elements['capsfilter'].se<wbr>t_property('caps', Gst.Caps.from_string('video/x-<wbr>raw, format=RGB'))<br>        self.elements['raw2queue'] = Gst.ElementFactory.make('queue<wbr>')<br>        self.elements['rawsink'] = Gst.ElementFactory.make('appsi<wbr>nk')<br><br>        self.pipeline_front.add(self.e<wbr>lements['filesrc'])<br>        self.pipeline_front.add(self.e<wbr>lements['matroskademux'])<br>        self.pipeline_front.add(self.e<wbr>lements['h264parse'])<br>        self.pipeline_front.add(self.e<wbr>lements['raw1queue'])<br>        self.pipeline_front.add(self.e<wbr>lements['innersink'])<br><br>        self.pipeline_end.add(self.ele<wbr>ments['innersrc'])<br>        self.pipeline_end.add(self.ele<wbr>ments['avdec_h264'])<br>        self.pipeline_end.add(self.ele<wbr>ments['videoconvert'])<br>        self.pipeline_end.add(self.ele<wbr>ments['capsfilter'])<br>        self.pipeline_end.add(self.ele<wbr>ments['raw2queue'])<br>        self.pipeline_end.add(self.ele<wbr>ments['rawsink'])<br><br>....<br>            self.elements = {}<br>            self.elements['mp4appsrc'] = Gst.ElementFactory.make('appsr<wbr>c')<br>            self.elements['mp4appsrc'].set<wbr>_property('format', Gst.Format.TIME)<br>            self.elements['mp4appsrc'].con<wbr>nect('need-data', need_data)<br>            self.elements['mp4h264parse'] = Gst.ElementFactory.make('h264p<wbr>arse')<br><br>            self.elements['mp4queue'] = Gst.ElementFactory.make('queue<wbr>')<br>            self.elements['mp4mux'] = Gst.ElementFactory.make('mp4mu<wbr>x')<br>            self.elements['mp4mux'].set_pr<wbr>operty('fragment-duration', 1)<br>            self.elements['mp4mqueue'] = Gst.ElementFactory.make('queue<wbr>')<br>            self.elements['mp4filesink'] = Gst.ElementFactory.make('files<wbr>ink')<br>            self.elements['mp4filesink'].s<wbr>et_property('location', self.mkv_data[self.mkv_filenam<wbr>e]['path'])<br><br>            self.pipeline.add(self.element<wbr>s['mp4appsrc'])<br>            self.pipeline.add(self.element<wbr>s['mp4h264parse'])<br>            self.pipeline.add(self.element<wbr>s['mp4queue'])<br>            self.pipeline.add(self.element<wbr>s['mp4mux'])<br>            self.pipeline.add(self.element<wbr>s['mp4mqueue'])<br>            self.pipeline.add(self.element<wbr>s['mp4filesink'])<br><br></div>The first two are involved in just stepping through the frames and allowing them to be used outside of the pipeline at two parts. The last pipeline is taking the output from the first pipeline and converting it into mp4. The first two are in PAUSED mode for trick-mode and the last is in PLAYING mode. I ended up using PLAYING mode because I had trouble closing the MP4 file while in PAUSED mode. They are all connected manually with python code where I am passing the frames between them as needed. <br><br></div><div>Another important note is that I have multiple processes running their own version of the combination of the 3 pipelines on different files. There would be around 16 processes per node all sharing the same disk.<br><br></div><div>I can't seem to make the errors a repeatable example as it seems to occur randomly on random files. It almost seems like a race condition or perhaps gstreamer is using a shared cache space on the file system where they are all competing with each other. <br><br></div><div>I just noticed that it is hanging at the end of some of the files (in the third pipeline) while I wait for the EOS. I know when I am done with frames so I attempt to send the EOS myself like such:<br><br>             self.elements['mp4appsrc'].<wbr>emit('end-of-stream')<br>             bus = self.pipeline.get_bus()<br>            #self.check_pipe('endpipe', self.pipeline)<br>            while True:<br>                message = bus.pop_filtered(Gst.<wbr>MessageType.ANY)<br>                if message == None:<br>                    continue<br>                if message.type == Gst.MessageType.ERROR:<br>                    LOG.warn('PIPE ERROR G'.format(message.parse_error(<wbr>)))<br>                if message and message.type in [Gst.MessageType.EOS, Gst.MessageType.ERROR]:<br>                    break<br>            self.pipeline.set_state(Gst.<wbr>State.PAUSED)<br>            self.pipeline.set_state(Gst.<wbr>State.NULL)<br><br></div><div>This is the only way I could get the file to close properly (when it doesn't hang). I would be much happier if I could close this in a better way from the PAUSED state.<br><br></div><div>Any thoughts would be helpful.<br><br></div><div>Thanks,<br></div><div>Brian<br></div><div><div><br><br><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 8, 2016 at 10:26 AM, Tim Müller <span dir="ltr"><<a href="mailto:tim@centricular.com" target="_blank">tim@centricular.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, 2016-08-08 at 10:07 -0400, Brian Panneton wrote:<br>
<br>
Hi Brian,<br>
<span><br>
> These keep coming up as well and I can't seem to catch the errors<br>
> within code.<br>
><br>
> 0:00:12.830815243  4277      0x35e9cf0 ERROR                  libav<br>
> :0:: get_buffer() failed (-1 2 (nil))<br>
> 0:00:12.830839083  4277      0x35e9cf0 ERROR                  libav<br>
> :0:: decode_slice_header error<br>
> 0:00:12.830853090  4277      0x35e9cf0 ERROR                  libav<br>
> :0:: mmco: unref short failure<br>
><br>
> I noticed that when these errors come up my processing seems to hang.<br>
> If these are not critical errors that it might be due to something<br>
> else within my pipeline.<br>
<br>
</span>You can only capture those by installing a log handler with<br>
gst_debug_add_log_function(), but I really don't recommend it, since it<br>
might be expected and harmless in some cases. Again, without context<br>
it's hard to comment further. It indicates data corruption that should<br>
usually be recoverable.<br>
<br>
It might be better to add a watchdog element that posts an error message after a certain time without any buffers flowing.<br>
<br>
Not sure why your processing comes to a halt, what does your pipeline look like?<br>
<div><div><br>
Cheers<br>
 -Tim<br>
<br>
--<br>
Tim Müller, Centricular Ltd - <a href="http://www.centricular.com" rel="noreferrer" target="_blank">http://www.centricular.com</a><br>
______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesk<wbr>top.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-dev<wbr>el</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>