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 692012 - assrender: fix, re-enable and add overlay support
assrender: fix, re-enable and add overlay support
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.x
Other Linux
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-01-18 14:33 UTC by Arnaud Vrac
Modified: 2013-01-22 00:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proxy allocations on video pad (912 bytes, patch)
2013-01-18 14:33 UTC, Arnaud Vrac
committed Details | Review
Refactor to avoid code duplication (8.07 KB, patch)
2013-01-18 14:34 UTC, Arnaud Vrac
committed Details | Review
Fix some subtitles not being shown (4.60 KB, patch)
2013-01-18 14:35 UTC, Arnaud Vrac
committed Details | Review
Add support for overlay composition (9.27 KB, patch)
2013-01-18 14:41 UTC, Arnaud Vrac
none Details | Review
Up rank to primary again now that the unit tests pass (888 bytes, patch)
2013-01-18 14:48 UTC, Arnaud Vrac
none Details | Review
Up rank to primary again now that the unit tests pass (1.51 KB, patch)
2013-01-18 14:52 UTC, Arnaud Vrac
committed Details | Review
Add support for overlay composition (9.29 KB, patch)
2013-01-18 14:58 UTC, Arnaud Vrac
committed Details | Review
Remove format specific blit functions and use overlay composition instead (12.45 KB, patch)
2013-01-18 15:19 UTC, Arnaud Vrac
committed Details | Review

Description Arnaud Vrac 2013-01-18 14:33:19 UTC
Here are some patches for assrender to make it work better in 1.0.
Comment 1 Arnaud Vrac 2013-01-18 14:33:55 UTC
Created attachment 233755 [details] [review]
Proxy allocations on video pad
Comment 2 Arnaud Vrac 2013-01-18 14:34:27 UTC
Created attachment 233756 [details] [review]
Refactor to avoid code duplication
Comment 3 Arnaud Vrac 2013-01-18 14:35:57 UTC
Created attachment 233757 [details] [review]
Fix some subtitles not being shown

Some subtitles were not being shown anymore after 2213a44214763f
Comment 4 Arnaud Vrac 2013-01-18 14:41:25 UTC
Created attachment 233758 [details] [review]
Add support for overlay composition

An intermediate ARGB buffer is allocated to composite the ASS images, which is attached to an overlay composition. libass can detect when the subtitles change so we only render the overlay when needed, not for every frame.

The patch could be extended to use overlay composition and blend it on the video frames. Rendering might be faster because the ASS images are only composited once on the intermediate buffer. This would also make the plugin support all 8-bit pixel formats.
Comment 5 Arnaud Vrac 2013-01-18 14:48:38 UTC
Created attachment 233759 [details] [review]
Up rank to primary again now that the unit tests pass
Comment 6 Arnaud Vrac 2013-01-18 14:52:52 UTC
Created attachment 233760 [details] [review]
Up rank to primary again now that the unit tests pass
Comment 7 Arnaud Vrac 2013-01-18 14:58:24 UTC
Created attachment 233762 [details] [review]
Add support for overlay composition

A gst_query_unref was missing in the previous patch
Comment 8 Arnaud Vrac 2013-01-18 15:19:16 UTC
Created attachment 233765 [details] [review]
Remove format specific blit functions and use overlay composition instead
Comment 9 Arnaud Vrac 2013-01-19 01:22:20 UTC
It seems there can be a deadlock after a seek, assrender will wait for a textbuffer forever when used in a multiqueue. I will try to fix it and post the full patch set to a git repo.
Comment 10 Arnaud Vrac 2013-01-21 10:02:35 UTC
The deadlock was due to the missing wait-text property, which I added. I have pushed my patches here: https://github.com/rawoul/gst-plugins-bad/commits/master.

Please ignore the last patch which is for high quality overlay rendering but is not usable with gstreamer master.
Comment 11 Tim-Philipp Müller 2013-01-22 00:30:20 UTC
Thanks a lot for the patches!


commit 8d837cbac41b121760207e784ba7b54f1ef84f32
Author: Arnaud Vrac <avrac@freebox.fr>
Date:   Thu Jan 17 19:02:48 2013 +0100

    assrender: reenable unit tests and up rank to primary again

commit 143c0cbd45008c208fe8f2201429adb54c101ad2
Author: Arnaud Vrac <avrac@freebox.fr>
Date:   Fri Jan 18 16:14:03 2013 +0100

    assrender: use overlay composition to blit subtitles on video frames
    
    Re-uses existing blitting code and also means we can support
    a lot more video formats out of the box, hence avoid unnecessary
    pixel format or colour space conversions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692012

commit 5f913665537e40758540eb8fa9858adace3650bd
Author: Arnaud Vrac <avrac@freebox.fr>
Date:   Thu Jan 17 18:48:12 2013 +0100

    assrender: render overlay composition if supported downstream
    
    This allows rendering ASS subtitles on top of video when
    using hardware-accelerated video decoders based on e.g.
    VA-API or VDPAU.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678389
    https://bugzilla.gnome.org/show_bug.cgi?id=692012

commit 30222d608044bcd29537218309882f43f3c35963
Author: Arnaud Vrac <avrac@freebox.fr>
Date:   Mon Jan 21 10:35:49 2013 +0100

    assrender: add wait-text property
    
    This is the same property as in the pango element, to allow waiting for
    text on the text pad before rendering the video.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692012

commit c78714ced3c46f4c0aa66dfdcc909baee2783fa4
Author: Arnaud Vrac <avrac@freebox.fr>
Date:   Fri Jan 18 15:25:48 2013 +0100

    assrender: fix some subtitles being ignored
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692012

commit c16d41d7091f808d5c3b06b79160dbe187594ead
Author: Arnaud Vrac <avrac@freebox.fr>
Date:   Thu Jan 17 18:33:11 2013 +0100

    assrender: refactor code to avoid duplication
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692012

commit 61976b7aa71ab55f0028a1d2fea888a072e945a0
Author: Arnaud Vrac <avrac@freebox.fr>
Date:   Thu Jan 17 18:26:08 2013 +0100

    assrender: proxy allocations on video pad
    
    Forward allocation queries on video sink pad instead
    of discarding them.
    
    This allows the upstream elements to use the allocation
    parameters or pools from the downstream elements like
    videosink.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692012