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 614942 - playbin2: "text-sink" is supposed to handle raw subtitle data?
playbin2: "text-sink" is supposed to handle raw subtitle data?
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.28
Other Linux
: Normal normal
: 0.10.30
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 616377 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-04-06 09:27 UTC by Changwoo Ryu
Modified: 2010-04-29 17:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
playbin2: Set subtitle encoding on the decodebins again (2.94 KB, patch)
2010-04-23 14:09 UTC, Sebastian Dröge (slomo)
committed Details | Review
playbin2: If a text sink is provided, let subtitle parsing be done by decodebin2 if required (1.47 KB, patch)
2010-04-23 14:09 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Changwoo Ryu 2010-04-06 09:27:57 UTC
playbin2's "text-sink" property does not work as it seems. 

$ gst-inspect playbin2|grep text-sink
  text-sink           : the text output element to use (NULL = default textoverlay)
$

I expected "text-sink" just rendered text. But actually the text-sink needs to parse raw subtitle data, rather than parsed text. Like this:

$ gst-launch playbin2 ....  text-sink="subparse ! fakesink dump=1"

I'm not sure whether it is intended. But I think most application authors don't want to change subtitle parsing, but just want to redirect the subtitle output.
Comment 1 Sebastian Dröge (slomo) 2010-04-06 09:59:52 UTC
What would you define as raw parsed text? Just UTF8 plaintext? Pango markup? srt subtitles?

The text-sink also gets subpicture text streams btw... so in any case, you have to handle different formats there.
Comment 2 Changwoo Ryu 2010-04-06 11:10:38 UTC
It is OK to handle different formats including subpictures. But in case of raw unparsed subtitles (srt/smi/etc.), it has no timestamps and all of them need subparse element.
Comment 3 Sebastian Dröge (slomo) 2010-04-07 10:00:23 UTC
Ok, so you would be fine with subpictures, pango markup, srt/smi/etc, ... as long as the buffers are timestamped?
Comment 4 Changwoo Ryu 2010-04-07 10:52:38 UTC
srt/smi/etc formats need to be parsed first to be timestamped correctly.
Comment 5 Sebastian Dröge (slomo) 2010-04-07 12:02:28 UTC
It could come from a container format with timestamps I guess...

Well, we should probably add a parsed=true field to the subtitle caps and only accept those before the subtitle sink. I agree that the current behaviour is a bit suboptimal.
Comment 6 Sebastian Dröge (slomo) 2010-04-23 09:12:33 UTC
Ok, one solution here would be, to set the raw caps on decodebin2 not to all supported subtitle formats but only to those supported by the subtitle sink (if a subtitle sink is used). I'll work on that later...
Comment 7 Sebastian Dröge (slomo) 2010-04-23 14:09:51 UTC
Created attachment 159429 [details] [review]
playbin2: Set subtitle encoding on the decodebins again
Comment 8 Sebastian Dröge (slomo) 2010-04-23 14:09:56 UTC
Created attachment 159430 [details] [review]
playbin2: If a text sink is provided, let subtitle parsing be done by decodebin2 if required

This way subtitle sinks only get buffers in the format that they
understand, i.e. raw parsed text in most cases.

Fixes bug #614942.
Comment 9 Sebastian Dröge (slomo) 2010-04-23 14:10:15 UTC
*** Bug 616377 has been marked as a duplicate of this bug. ***
Comment 10 Sebastian Dröge (slomo) 2010-04-23 14:11:25 UTC
These patches should fix your problem as long as the text-sink sinkpad provides correct caps, i.e. "text/x-plain; text/x-pango-markup"

Please test them, I'll push this after 0.10.29 release.
Comment 11 Andreas Frisch 2010-04-27 13:51:33 UTC
not confirmed :(

still spits out

root@dm8000:/testProgs# ./playbin-text file:///hdd/movie/mkv/boston.legal.s04e01.mkv file:///hdd/movie/mkv/boston.legal.s04e01.srt
** Message: using external subtitles file:///hdd/movie/mkv/boston.legal.s04e01.srt
** Message: received a subtitle at position 855443:32:57.935404848, running_time 0:00:00.012033000
00000000 (0x48c000): 31 0d 0a 30 30 3a 30 30 3a 30 30 2c 30 31 30 20  1..00:00:00,010 
00000010 (0x48c010): 2d 2d 3e 20 30 30 3a 30 30 3a 30 31 2c 32 33 30  --> 00:00:01,230
00000020 (0x48c020): 0d 0a 42 69 73 68 65 72 20 62 65 69 20 26 71 75  ..Bisher bei &qu
00000030 (0x48c030): 6f 74 3b 42 6f 73 74 6f 6e 20 4c 65 67 61 6c 26  ot;Boston Legal&
00000040 (0x48c040): 71 75 6f 74 3b 2e 2e 2e 0d 0a 0d 0a 32 0d 0a 30  quot;.......2..0
00000050 (0x48c050): 30 3a 30 30 3a 30 31 2c 32 34 30 20 2d 2d 3e 20  0:00:01,240 --> 
00000060 (0x48c060): 30 30 3a 30 30 3a 30 32 2c 34 34 30 0d 0a 3c 62  00:00:02,440..<b
00000070 (0x48c070): 3e 49 63 68 20 62 69 6e 20 22 6b 65 69 6e 65 22  >Ich bin "keine"
00000080 (0x48c080): 20 50 73 79 63 68 6f 6c 6f 67 69 6e 2c 3c 2f 62   Psychologin,</b
00000090 (0x48c090): 3e 0d 0a 0d 0a 33 0d 0a 30 30 3a 30 30 3a 30 32  >....3..00:00:02
000000a0 (0x48c0a0): 2c 34 35 30 20 2d 2d 3e 20 30 30 3a 30 30 3a 30  ,450 --> 00:00:0
000000b0 (0x48c0b0): 35 2c 36 33 30 0d 0a 61 62 65 72 20 69 63 68 20  5,630..aber ich 
000000c0 (0x48c0c0): 64 65 6e 6b 65 2c 20 64 69 65 20 62 65 73 74 65  denke, die beste
000000d0 (0x48c0d0): 20 4d f6 67 6c 69 63 68 6b 65 69 74 20 73 65 69   M.glichkeit sei
000000e0 (0x48c0e0): 6e 65 20 41 6e 67 73 74 0d 0a 7a 75 20 fc 62 65  ne Angst..zu .be
000000f0 (0x48c0f0): 72 77 69 6e 64 65 6e 2c 20 69 73 74 20 64 61 72  rwinden, ist dar
00000100 (0x48c100): fc 62 65 72 20 7a 75 20 72 65 64 65 6e 2e 0d 0a  .ber zu reden...
00000110 (0x48c110): 0d 0a 34 0d 0a 30 30 3a 30 30 3a 30 35 2c 36 34  ..4..00:00:05,64
00000120 (0x48c120): 30 20 2d 2d 3e 20 30 30 3a 30 30 3a 30 36 2c 34  0 --> 00:00:06,4
00000130 (0x48c130): 30 30 0d 0a 3c 69 3e 48 75 6d 70 65 72 64 69 6e  00..<i>Humperdin..............

all at the beginning
even though i've added the line
  g_object_set (G_OBJECT (app->textsink), "caps", gst_caps_from_string(" text/x-plain "), NULL);
to my playbin-text testcase ( https://bugzilla.gnome.org/show_bug.cgi?id=616377 )
Comment 12 Sebastian Dröge (slomo) 2010-04-27 17:05:48 UTC
Could you check what caps the buffers have, that you get in your sink? I used your test and set the caps of appsink to "text/plain" and got timestamped and parsed buffers.
Comment 13 Andreas Frisch 2010-04-27 21:14:03 UTC
sebastian sorry i tested with the wrong binary! so now text/x-plain gives a data flow error but with pango-markup, it works as expected. thanks a lot!
Comment 14 Sebastian Dröge (slomo) 2010-04-28 07:51:34 UTC
Great, thanks for confirming :)

You might want to add support for correct negotiation in subparse to make sure that text/x-plain is used when downstream doesn't support text/x-pango-markup.
Comment 15 Sebastian Dröge (slomo) 2010-04-29 17:06:58 UTC
commit cc8a5bdcd322efcdc7814483e71d0349e81f24a0
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Fri Apr 23 16:08:14 2010 +0200

    playbin2: If a text sink is provided, let subtitle parsing be done by decode
    
    This way subtitle sinks only get buffers in the format that they
    understand, i.e. raw parsed text in most cases.
    
    Fixes bug #614942.