avdec_h264 Error Messages

Brian Panneton brian.panneton at gmail.com
Mon Aug 8 20:08:39 UTC 2016


Continuing to dig deeper, I have tracked down another location where it is
hanging which might be the culprit.

        self.pipeline_front.get_state(Gst.CLOCK_TIME_NONE)[0]

self.elements['innersink'].send_event(Gst.Event.new_step(Gst.Format.BUFFERS,
1, 1, True, False))
        self.inner_sample = self.elements['innersink'].emit('pull-preroll')
        self.inner_buffer = self.inner_sample.get_buffer()
        self.elements['innersrc'].set_property('caps',
self.inner_sample.get_caps())
        self.elements['innersrc'].emit('push-buffer', self.inner_buffer)

        self.raw_sample = self.elements['rawsink'].emit('pull-preroll')
<-------------------- Hangs on this statement
        self.raw_buffer = self.raw_sample.get_buffer()

        if (self.pipeline_front.get_state(Gst.CLOCK_TIME_NONE)[0] !=
Gst.StateChangeReturn.SUCCESS):
            LOG.warn('Pipeline did not get a success status:
{0}'.format(self.pipeline_front.get_state(Gst.CLOCK_TIME_NONE)))

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.


On Mon, Aug 8, 2016 at 11:45 AM, Brian Panneton <brian.panneton at gmail.com>
wrote:

> It is actually a combination of 3 manually connected pipelines:
>
>         self.elements = {}
>         self.elements['filesrc'] = Gst.ElementFactory.make('filesrc')
>         self.elements['filesrc'].set_property('location', self.filename)
>         self.elements['matroskademux'] = Gst.ElementFactory.make('matro
> skademux')
>         self.elements['matroskademux'].connect('pad-added',
> self.demuxer_callback)
>         self.elements['h264parse'] = Gst.ElementFactory.make('h264parse')
>         self.elements['raw1queue'] = Gst.ElementFactory.make('queue')
>         self.elements['innersink'] = Gst.ElementFactory.make('appsink')
>
>         self.elements['innersrc'] = Gst.ElementFactory.make('appsrc')
>         self.elements['avdec_h264'] = Gst.ElementFactory.make('avdec
> _h264')
>         self.elements['videoconvert'] = Gst.ElementFactory.make('video
> convert')
>         self.elements['capsfilter'] = Gst.ElementFactory.make('capsf
> ilter')
>         self.elements['capsfilter'].set_property('caps',
> Gst.Caps.from_string('video/x-raw, format=RGB'))
>         self.elements['raw2queue'] = Gst.ElementFactory.make('queue')
>         self.elements['rawsink'] = Gst.ElementFactory.make('appsink')
>
>         self.pipeline_front.add(self.elements['filesrc'])
>         self.pipeline_front.add(self.elements['matroskademux'])
>         self.pipeline_front.add(self.elements['h264parse'])
>         self.pipeline_front.add(self.elements['raw1queue'])
>         self.pipeline_front.add(self.elements['innersink'])
>
>         self.pipeline_end.add(self.elements['innersrc'])
>         self.pipeline_end.add(self.elements['avdec_h264'])
>         self.pipeline_end.add(self.elements['videoconvert'])
>         self.pipeline_end.add(self.elements['capsfilter'])
>         self.pipeline_end.add(self.elements['raw2queue'])
>         self.pipeline_end.add(self.elements['rawsink'])
>
> ....
>             self.elements = {}
>             self.elements['mp4appsrc'] = Gst.ElementFactory.make('appsrc')
>             self.elements['mp4appsrc'].set_property('format',
> Gst.Format.TIME)
>             self.elements['mp4appsrc'].connect('need-data', need_data)
>             self.elements['mp4h264parse'] = Gst.ElementFactory.make('h264p
> arse')
>
>             self.elements['mp4queue'] = Gst.ElementFactory.make('queue')
>             self.elements['mp4mux'] = Gst.ElementFactory.make('mp4mux')
>             self.elements['mp4mux'].set_property('fragment-duration', 1)
>             self.elements['mp4mqueue'] = Gst.ElementFactory.make('queue')
>             self.elements['mp4filesink'] = Gst.ElementFactory.make('files
> ink')
>             self.elements['mp4filesink'].set_property('location',
> self.mkv_data[self.mkv_filename]['path'])
>
>             self.pipeline.add(self.elements['mp4appsrc'])
>             self.pipeline.add(self.elements['mp4h264parse'])
>             self.pipeline.add(self.elements['mp4queue'])
>             self.pipeline.add(self.elements['mp4mux'])
>             self.pipeline.add(self.elements['mp4mqueue'])
>             self.pipeline.add(self.elements['mp4filesink'])
>
> 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.
>
> 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.
>
> 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.
>
> 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:
>
>              self.elements['mp4appsrc'].emit('end-of-stream')
>              bus = self.pipeline.get_bus()
>             #self.check_pipe('endpipe', self.pipeline)
>             while True:
>                 message = bus.pop_filtered(Gst.MessageType.ANY)
>                 if message == None:
>                     continue
>                 if message.type == Gst.MessageType.ERROR:
>                     LOG.warn('PIPE ERROR G'.format(message.parse_error()))
>                 if message and message.type in [Gst.MessageType.EOS,
> Gst.MessageType.ERROR]:
>                     break
>             self.pipeline.set_state(Gst.State.PAUSED)
>             self.pipeline.set_state(Gst.State.NULL)
>
> 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.
>
> Any thoughts would be helpful.
>
> Thanks,
> Brian
>
>
>
>
> On Mon, Aug 8, 2016 at 10:26 AM, Tim Müller <tim at centricular.com> wrote:
>
>> On Mon, 2016-08-08 at 10:07 -0400, Brian Panneton wrote:
>>
>> Hi Brian,
>>
>> > These keep coming up as well and I can't seem to catch the errors
>> > within code.
>> >
>> > 0:00:12.830815243  4277      0x35e9cf0 ERROR                  libav
>> > :0:: get_buffer() failed (-1 2 (nil))
>> > 0:00:12.830839083  4277      0x35e9cf0 ERROR                  libav
>> > :0:: decode_slice_header error
>> > 0:00:12.830853090  4277      0x35e9cf0 ERROR                  libav
>> > :0:: mmco: unref short failure
>> >
>> > I noticed that when these errors come up my processing seems to hang.
>> > If these are not critical errors that it might be due to something
>> > else within my pipeline.
>>
>> You can only capture those by installing a log handler with
>> gst_debug_add_log_function(), but I really don't recommend it, since it
>> might be expected and harmless in some cases. Again, without context
>> it's hard to comment further. It indicates data corruption that should
>> usually be recoverable.
>>
>> It might be better to add a watchdog element that posts an error message
>> after a certain time without any buffers flowing.
>>
>> Not sure why your processing comes to a halt, what does your pipeline
>> look like?
>>
>> Cheers
>>  -Tim
>>
>> --
>> Tim Müller, 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/20160808/0bfbda9c/attachment-0001.html>


More information about the gstreamer-devel mailing list