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 762620 - Playback stutters with avdec_h264 via glimagesink on OSX (gst_gl_context_is_shared() returning FALSE)
Playback stutters with avdec_h264 via glimagesink on OSX (gst_gl_context_is_s...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Mac OS
: Normal blocker
: 1.7.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-24 15:40 UTC by Heinrich Fink
Modified: 2016-02-26 14:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
*:6 debug logs (1.04 MB, application/x-xz)
2016-02-24 15:40 UTC, Heinrich Fink
Details
gl*:6 logs (188.51 KB, application/x-xz)
2016-02-24 15:40 UTC, Heinrich Fink
Details

Description Heinrich Fink 2016-02-24 15:40:01 UTC
Created attachment 322251 [details]
*:6 debug logs

When launching the following pipeline: 

gst-launch-1.0 filesrc location=/PATH/TO/claudia_aac.mov ! qtdemux name=mux mux.video_0 ! avdec_h264 ! videoconvert ! glupload ! glimagesink

we get a few corrupt frames, and then playback stutters heavily. Debug logs are attached, once for gl*:6, and once for *:6.

The same pipeline would play back smoothly using vtdec_hw instead of avdec_h264 (also not showing corrupt frames in the beginning)

File to play back: https://www.dropbox.com/s/gwgzsx8t5bvrnyi/claudia_h264.mov?dl=0
Comment 1 Heinrich Fink 2016-02-24 15:40:27 UTC
Created attachment 322252 [details]
gl*:6 logs
Comment 2 Jan Schmidt 2016-02-25 00:12:50 UTC
Try this:

gst-launch-1.0 filesrc location=/PATH/TO/claudia_aac.mov ! qtdemux name=mux mux.video_0 ! avdec_h264 output-corrupt=false ! videoconvert ! queue max-size-buffers=2 ! glupload ! glimagesink

Adding a queue means the decoder isn't stuck waiting for frame display before it can start decoding the next frame.
Comment 3 Heinrich Fink 2016-02-25 10:29:20 UTC
Thanks, but your modified launch line yields exactly the same results: a few corrupted frames, and stuttering, with this morning's build. I'll try to bisect gst-plugins-bad today and provide more information then.
Comment 4 Heinrich Fink 2016-02-25 13:34:17 UTC
I managed to bisect gst-plugins-bad: 

11fb4fff80b63b9d67a731d4bb238b6c0a29d774 is the first bad commit
commit 11fb4fff80b63b9d67a731d4bb238b6c0a29d774
Author: Matthew Waters <matthew@centricular.com>
Date:   Thu Jan 7 14:08:39 2016 +1100

    glsyncmeta: only flush with a shared context

    The wait code will flush for us for single context pipelines.
Comment 5 Matthew Waters (ystreet00) 2016-02-26 00:03:10 UTC
Thanks!

commit abec124f6946e9fe0635dc53d729b3c2d92be9a9
Author: Matthew Waters <matthew@centricular.com>
Date:   Fri Feb 26 08:34:11 2016 +1100

    glcontext: add a method to add a context to another share group
    
    Intended for use with wrapped contexts that are created shared with gst's
    gl contexts in order to manage the internal sharegroup state correctly.
    
    e.g. with caopengllayer (which is used in glimagesink and caopengllayersink
    on OS X), we create a CGL context from the gst context and the sharing state
    was not being correctly set on either GL context and gst_gl_context_is_shared()
    was always returning FALSE.
    
    With 11fb4fff80b63b9d67a731d4bb238b6c0a29d774 only flushing with multiple
    shared contexts, the required flush was not occuring causing screen
    corruption or stuttering.
    
    Note: this didn't affect GST_GL_API=opengl pipelines
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762620
Comment 6 Heinrich Fink 2016-02-26 14:05:20 UTC
Thanks, Matthew!