After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 722290 - avviddec: mark buffers as corrupted if libav tells us so
avviddec: mark buffers as corrupted if libav tells us so
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-01-15 19:53 UTC by Aleix Conchillo Flaqué
Modified: 2014-01-16 12:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mark buffers as corrupted (1.81 KB, patch)
2014-01-15 19:57 UTC, Aleix Conchillo Flaqué
none Details | Review
mark buffers as corrupted in avviddec (2.26 KB, patch)
2014-01-15 21:12 UTC, Aleix Conchillo Flaqué
rejected Details | Review

Description Aleix Conchillo Flaqué 2014-01-15 19:53:22 UTC
In 0.10 I had a workaround that checked for buffer flags (delta units and discont) to know whether I had received a key frame. The workaround was used for clients connected to a gst-rtsp-server based server that didn't receive a key frame as the first buffer. Another solution would be to fix that in the server (some work has been done regarding this, lately, see bug 711257).

In 1.0, the delta unit is used properly and frames that can be decoded (even there's a missing reference frame) are not marked with any flags. However this frame will have information that shouldn't really be displayed to the user.

So, it would be nice if buffers that come before a synchronization point would be marked with the corrupted flag.
Comment 1 Aleix Conchillo Flaqué 2014-01-15 19:57:14 UTC
Created attachment 266385 [details] [review]
mark buffers as corrupted

Proposal to mark buffers as corrupted if no sync point has arrived before.
Comment 2 Aleix Conchillo Flaqué 2014-01-15 20:00:36 UTC
This came out after a short conversation with Olivier on IRC where he made that suggestion when I commented about the 0.10 and 1.0 differences I found.

So, this is just a proposal. May be there's currently another way to achieve this or a better way to implement it.
Comment 3 Sebastian Dröge (slomo) 2014-01-15 20:03:26 UTC
Frames before the first keyframe are not necessarily corrupted, in some cases they can be decoded without problems.

Still might be useful to mark them somehow, but the corrupted flag seems wrong for this reason.
Comment 4 Aleix Conchillo Flaqué 2014-01-15 20:06:50 UTC
(In reply to comment #3)
> Frames before the first keyframe are not necessarily corrupted, in some cases
> they can be decoded without problems.
> 
> Still might be useful to mark them somehow, but the corrupted flag seems wrong
> for this reason.

Agreed, I couldn't find any other flag that made sense though.

As I mention in the bug description frames can still be decoded, but it would be nice to mark them some how so the user can choose what to do with them.
Comment 5 Aleix Conchillo Flaqué 2014-01-15 20:48:29 UTC
I just filed a bug to libav to see if it is possible to add information to know if frames can be decoded even the reference key frame is not present.

https://bugzilla.libav.org/show_bug.cgi?id=628
Comment 6 Aleix Conchillo Flaqué 2014-01-15 21:12:28 UTC
Created attachment 266396 [details] [review]
mark buffers as corrupted in avviddec

We mark buffers as corrupted if they were decoded but no key frame was found before.

Actually, it would be better to use another buffer flag to properly indicate this (as Sebastian has pointed). Also, this could happen in the middle of the stream, so the buffers will not be marked properly with this patch. However, if I am not wrong, this is something that would need to be added in libav.
Comment 7 Sebastian Dröge (slomo) 2014-01-16 12:46:55 UTC
Better to use the flag that libav provides us :)

commit d494f6f9837d1fff575d0959cdb2e817855d8d6e
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Thu Jan 16 13:45:58 2014 +0100

    avauddec: Mark frames as corrupted if libav tells us they are
    
    This is currently only implemented by the h264 codec and no audio codec.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722290

commit b278ca55bec70bafbd5c1d2ba9a8a1d4fa24ec7f
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Thu Jan 16 13:44:56 2014 +0100

    avviddec: Mark frames as corrupted if libav tells us they are
    
    This is currently only implemented by the h264 codec.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722290