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 735944 - assrender: Totem does not show separate subtitle lines overlapping in time
assrender: Totem does not show separate subtitle lines overlapping in time
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.x
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-03 01:19 UTC by Eddy Castillo
Modified: 2018-08-14 13:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Epiphany and Totem playing a matroska file with multiline subtitles (567.44 KB, image/png)
2014-09-03 19:38 UTC, Eddy Castillo
  Details
totem gst-debug-level 4 (414.98 KB, text/plain)
2014-09-04 12:30 UTC, Eddy Castillo
  Details
sample file for assrender: 1:48-1:55 should have two subs displayed at the same time.mkv (434.77 KB, application/octet-stream)
2015-10-16 13:25 UTC, Tim-Philipp Müller
  Details
minimal .ass file (2.41 KB, text/plain)
2015-10-16 13:40 UTC, Tim-Philipp Müller
  Details
sample file: should have two subs displayed at the same time from 18-25 secs (mkv) (377.48 KB, application/octet-stream)
2015-10-16 13:41 UTC, Tim-Philipp Müller
  Details
This is a video file I have been using to test. (204.75 KB, video/x-matroska)
2018-07-18 10:26 UTC, Michael Drake
  Details
SSA/ASS: Patch to fix multiple simultanious subtitles issue. (10.31 KB, patch)
2018-07-18 10:30 UTC, Michael Drake
committed Details | Review

Description Eddy Castillo 2014-09-03 01:19:23 UTC
Totem doesn't seem to be able to show two separate lines of subtitle that overlap in time. This is from an ssa/ass subtitle embedded in a mkv file.

=================
Dialogue: 5,0:00:17.83,0:00:22.20,Default,N,0000,0000,0000,,{\i1}No vine a este parque con algo en mente.
Dialogue: 1,0:00:19.03,0:00:20.12,signs,,0000,0000,0000,,{\fnAbyss TS\blur0.8\an9\fs55\pos(1179,451)}Por favor, aparquen\N sus bicicletas. \N {\fs25}Administración del Parque
=================

The first line starts at 17.83 seconds, and the second line is only shown after the first one ends at 22.20 seconds, instead of starting at 19.03. It gets worse when there are 5 or more that starts at the same time and only shows the first one that reads from the file.

MKV file:
https://mega.co.nz/#!ugpAjALI!chruyiHW9VgvvK8wSPHOhxpgnZ1kNJ40OcP3QTBuAB0

Extracted subtitle file:
https://www.dropbox.com/s/nq0o0tf9judp9dy/bakemonogatari-03-spanish.ass?dl=0

Details:
totem-3.13.90-1.fc21.x86_64
gstreamer1-1.4.1-1.fc21.x86_64 (libav, bad, base, good, ugly)
Comment 1 Eddy Castillo 2014-09-03 19:38:21 UTC
Created attachment 285283 [details]
Epiphany and Totem playing a matroska file with multiline subtitles

As I don't know how to use gst-launch to test this, I used 'python3 -m http.server 9914' to play the file within epiphany, and it shows all the lines as specified in the subtitle track. 

So I'm assuming that GStreamer does support this feature, but Totem does not. Is this correct?

Details:
python3-3.4.1-14.fc21.x86_64
epiphany-3.13.90-1.fc21.x86_64
webkitgtk4-2.5.3-6.fc21.x86_64
gstreamer1-1.4.1-1.fc21.x86_64
Comment 2 Sebastian Dröge (slomo) 2014-09-04 07:55:34 UTC
It will render multi-line subtitles properly if the assrender element is used, and not if the subparse element is used. Can you confirm that assrender is not used together with totem for you?
Comment 3 Eddy Castillo 2014-09-04 12:30:38 UTC
Created attachment 285360 [details]
totem gst-debug-level 4

OK, so I did a 'totem --gst-debug-level=4' and I found both assrender and subparse in the output.

$ grep -i assrender totem-gst.txt
====================
0:00:01.208399621  3207      0x228d1e0 INFO      GST_PLUGIN_LOADING gstplugin.c:833:gst_plugin_load_file: plugin "/usr/lib64/gstreamer-1.0/libgstassrender.so" loaded
0:00:01.208659380  3207      0x228d1e0 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "assrender" named "renderer"
0:00:01.209216903  3207      0x228d1e0 INFO        GST_ELEMENT_PADS gstelement.c:643:gst_element_add_pad:<GstAssRender@0x274fb40> adding pad 'src'
0:00:01.209452948  3207      0x228d1e0 INFO        GST_ELEMENT_PADS gstelement.c:643:gst_element_add_pad:<GstAssRender@0x274fb40> adding pad 'video_sink'
0:00:01.209472286  3207      0x228d1e0 INFO        GST_ELEMENT_PADS gstelement.c:643:gst_element_add_pad:<GstAssRender@0x274fb40> adding pad 'text_sink'
====================

$ grep -i subparse totem-gst.txt 
====================
0:00:01.076787655  3207 0x7fd1c40d0c50 INFO            GST_TYPEFIND gsttypefind.c:71:gst_type_find_register: registering typefind function for subparse_typefind
0:00:01.077106747  3207 0x7fd1c40d0c50 INFO      GST_PLUGIN_LOADING gstplugin.c:833:gst_plugin_load_file: plugin "/usr/lib64/gstreamer-1.0/libgstsubparse.so" loaded
====================
Comment 4 Sebastian Dröge (slomo) 2014-09-04 12:36:57 UTC
So assrender is used in totem too, means something is wrong there
Comment 5 Tim-Philipp Müller 2015-10-16 13:25:05 UTC
Created attachment 313459 [details]
sample file for assrender: 1:48-1:55 should have two subs displayed at the same time.mkv
Comment 6 Tim-Philipp Müller 2015-10-16 13:40:13 UTC
Created attachment 313461 [details]
minimal .ass file
Comment 7 Tim-Philipp Müller 2015-10-16 13:41:28 UTC
Created attachment 313462 [details]
sample file: should have two subs displayed at the same time from 18-25 secs (mkv)
Comment 8 Michael Drake 2018-07-18 10:26:39 UTC
Created attachment 373081 [details]
This is a video file I have been using to test.

I test with:

GST_DEBUG=assrender:5,assrender_library:5 gst-launch-1.0 -v filesrc location=test-subs.mkv ! matroskademux name=d ! queue ! h264parse ! avdec_h264 ! videoconvert ! r.   d. ! queue ! "application/x-ass" ! assrender name=r ! videoconvert ! autovideosink
Comment 9 Michael Drake 2018-07-18 10:30:57 UTC
Created attachment 373082 [details] [review]
SSA/ASS: Patch to fix multiple simultanious subtitles issue.

Hi, I have written this patch to fix this bug.

Please let me know if its OK.

I have been testing by running this command with my video file that I attached before:

GST_DEBUG=assrender:5,assrender_library:5 gst-launch-1.0 -v filesrc location=../video/test-subs.mkv ! matroskademux name=d ! queue ! h264parse ! avdec_h264 ! videoconvert ! r.   d. ! queue ! "application/x-ass" ! assrender name=r ! videoconvert ! autovideosink

I have also tested it with Tim-Philipp Müller's attached .mkv file.
Comment 10 Jan Schmidt 2018-08-14 12:38:47 UTC
Review of attachment 373082 [details] [review]:

LGTM
Comment 11 Jan Schmidt 2018-08-14 13:01:25 UTC
Comment on attachment 373082 [details] [review]
SSA/ASS: Patch to fix multiple simultanious subtitles issue.

Thanks, committed:

commit bba33533ab589e254d2427036befec1493eca306 (HEAD -> master, origin/master, origin/HEAD)
Author: Michael Drake <michael.drake@codethink.co.uk>
Date:   Wed Jul 18 11:11:17 2018 +0100

    assrender: fix multiple subtitles on screen simultaneously
Comment 12 Michael Drake 2018-08-14 13:03:23 UTC
Thanks Jan!  :)