[Bug 697806] New: avdec_h264 Fails during error recovery after packet loss leading to stream corruption

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Apr 11 08:10:27 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=697806
  GStreamer | gst-libav | 1.0.5

           Summary: avdec_h264 Fails during error recovery after packet
                    loss leading to stream corruption
    Classification: Platform
           Product: GStreamer
           Version: 1.0.5
        OS/Version: Mac OS
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-libav
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: tcdgreenwood at hotmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


When using avdec_h264 with RTP it's fairly common to see a small amount of
packet loss.  Unfortunately this causes an error in gstreamer caused by the
codec attempting to recover from the error, the video passing through slowly
degrades.  When this error occurs the first time you usually see a completely
grey frame or just an outline of objects in the image on a grey background, the
video stream can then recover.  Usually if this error happens more than a few
time the video stream becomes intermittent with sections of grey frames and
sections of paused video.

The error you see is:

0:00:41.022060000 23892 0x7fd9040a1b70 WARN       
           libav
gstavviddec.c:655:gst_ffmpegviddec_get_buffer:<h264decode> already
alloc'ed output buffer for frame
0:00:41.022079000 23892 0x7fd9040a1b70 ERROR      
           libav :0:: get_buffer() failed (-1 2 0x0)
0:00:41.022087000 23892 0x7fd9040a1b70 ERROR      
           libav :0:: decode_slice_header error
0:00:41.022096000 23892 0x7fd9040a1b70 WARN       
           libav
gstavviddec.c:655:gst_ffmpegviddec_get_buffer:<h264decode> already
alloc'ed output buffer for frame
0:00:41.022119000 23892 0x7fd9040a1b70 ERROR      
           libav :0:: get_buffer() failed (-1 2 0x0)
0:00:41.022129000 23892 0x7fd9040a1b70 ERROR      
           libav :0:: decode_slice_header error
0:00:41.022134000 23892 0x7fd9040a1b70 ERROR      
           libav :0:: mmco: unref short failure
0:00:41.022149000 23892 0x7fd9040a1b70 INFO          
        libav :0:: concealing 396 DC, 396 AC, 396 MV errors


I have worked out this is because of some code in the libav h264 decoder that
allocates extra frames in order to do processing to help cover off the missing
frames in the stream - these frames are not used for any output and I am pretty
sure are destroyed before libav returns.  gstavviddec.c presumes that the
allocation function registered with libav will only be called once per output
frame.  It is not clear from the API documentation on libav how many times the
allocator should be called, and am going to create a patch which allows the
allocator to be called more than once per frame.  The extra allocation only
occurs when there is an error in the stream, so for non-RTP cases it's likely
that these issues would be very rarely seen.

I am not sure but I think the current system could lead to the original packet
being unreffed and then continued to be accessed - which could lead to worse
problems.  I'll be checking this now as I look into patching.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list