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 629764 - subparse: Add WebVTT support
subparse: Add WebVTT support
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
playback
: 629670 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-09-15 14:02 UTC by Philippe Normand
Modified: 2016-03-25 08:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
subparse: WebVTT parsing support (27.24 KB, patch)
2010-12-28 14:50 UTC, Philippe Normand
none Details | Review
subparse: WebVTT parsing support (27.09 KB, patch)
2016-03-07 13:35 UTC, Jan Schmidt
committed Details | Review

Description Philippe Normand 2010-09-15 14:02:27 UTC
WebSRT is the upcoming specification for HTML5 video closed captions. It'd be nice to have a parser for this format when the spec is validated.

See also http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#websrt-0

and:

http://blog.gingertech.net/2010/08/07/websrt-and-html5-media-accessibility/
Comment 1 Víctor Manuel Jáquez Leal 2010-09-16 08:41:00 UTC
adding me in CC
Comment 2 Sebastian Dröge (slomo) 2010-09-17 18:04:30 UTC
This can be easily added to the subparse plugin in gst-plugins-base. Looks *very* similar to normal srt with just some extensions which ignored in a first version.
Comment 3 Philippe Normand 2010-11-22 14:41:09 UTC
Hi,

I uploaded a branch for this, added websrt parsing support to subparse and store the cue settings in GstBufferMeta infos.

I also uploaded a buffermeta branch including a memleak fix that was reported to Wim but yet to be uploaded in his repo :)

See:

http://git.igalia.com/cgi-bin/gitweb.cgi?p=user/pnormand/gstreamer.git;a=shortlog;h=refs/heads/buffermeta

and 

http://git.igalia.com/cgi-bin/gitweb.cgi?p=user/pnormand/gst-plugins-base.git;a=shortlog;h=refs/heads/websrt

This is very experimental of course.
Comment 4 Philip Jägenstedt 2010-11-22 14:56:50 UTC
Note that the voices ("narrator", "music", "lyric", "sound", "comment", "credit") are likely going to be removed.

Also, since there's nothing to differentiate WebSRT and normal SRT, if you actually follow the WebSRT, any unescaped occurence of < in the cue text that isn't intended to start a new tag will be treated differently.

subrip_unescape_formatting looks a bit weird in how it uses tags_whitelist, maybe it would fit better in the tokenizer (which is what the spec says).
Comment 5 Sebastian Dröge (slomo) 2010-12-18 13:13:22 UTC
For now it would also be great to have something that works with GStreamer 0.10
Comment 6 Philippe Normand 2010-12-27 13:16:20 UTC
(In reply to comment #4)
> Note that the voices ("narrator", "music", "lyric", "sound", "comment",
> "credit") are likely going to be removed.
> 

Ok I'll remove support for parsing those then.

> Also, since there's nothing to differentiate WebSRT and normal SRT,

WebSRT was renamed to WebVTT 3 days ago :)
It seems the file first line has to be WEBVTT FILE or the parser should fail.
A text/vtt mimetype is also introduced.

http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#webvtt-0


> if you
> actually follow the WebSRT, any unescaped occurence of < in the cue text that
> isn't intended to start a new tag will be treated differently.
> 

Well in my current branch "foo < bar" would be parsed to "foo &lt; bar". Isn't that right?

> subrip_unescape_formatting looks a bit weird in how it uses tags_whitelist,
> maybe it would fit better in the tokenizer (which is what the spec says).

That's because the srt parser currently allows a fixed set of tags, so it escapes all the cue text and unescape it then based on that white list. I didn't change this from the original parser, I only refactored it to allow tags with more than one letter.

(In reply to comment #5)
> For now it would also be great to have something that works with GStreamer 0.10

Hum ok, so where/how do I store the cue settings?
Comment 7 Philippe Normand 2010-12-28 14:50:03 UTC
Created attachment 177138 [details] [review]
subparse: WebVTT parsing support

WebVTT is a new subtitle format for HTML5 video. In this firtst
version of the parser the cue settings are parsed but only stored in
the internal parser state structure. Later on these settings could be
part of the GstBuffer metadata.

Fixes bug #629764
Comment 8 Philippe Normand 2010-12-28 14:54:37 UTC
The "0.11" branch is there http://git.igalia.com/cgi-bin/gitweb.cgi?p=user/pnormand/gst-plugins-base.git;a=shortlog;h=refs/heads/webvtt

In that branch the cue settings are stored in buffer metadata.
Comment 9 Tim-Philipp Müller 2011-05-25 18:40:19 UTC
*** Bug 629670 has been marked as a duplicate of this bug. ***
Comment 10 Sebastian Dröge (slomo) 2013-05-03 13:01:44 UTC
Is that working with 1.0, is there a newer version of this already?
Comment 11 Philippe Normand 2013-05-03 15:22:33 UTC
This bug is still valid I think. AFAICS we have a webvttenc element now but way yet to parse text/vtt subtitles. Please correct me if I'm wrong :)
Comment 12 Sebastian Dröge (slomo) 2013-05-04 11:26:03 UTC
Yes, this bug is definitely still valid :) We have an encoder now in gst-plugins-bad but no decoding/parsing support for webvtt. Could you rebase your branch against latest git master?
Comment 13 Philippe Normand 2013-05-13 07:42:00 UTC
I'll have some time this week for this.

About the cue settings, do we still want to store them as metadata?
Comment 14 Sebastian Dröge (slomo) 2013-05-13 08:36:36 UTC
What exactly are the cue settings?
Comment 15 Philippe Normand 2013-05-13 11:06:57 UTC
They're specified in http://dev.w3.org/html5/webvtt/#dfn-webvtt-cue-settings
Comment 16 Sebastian Dröge (slomo) 2013-05-13 11:41:33 UTC
Can't they be converted to pango markup? Who would handle that metadata?
Comment 17 Carlos Rafael Giani 2015-02-21 19:37:40 UTC
What is the status of this? I have an immediate need for WebVTT support. What is missing?
Comment 18 Sebastian Dröge (slomo) 2015-02-22 08:39:21 UTC
I think what you see there is the latest status. Someone needs to update it to latest GIT, make it work and clean it up a bit probably and then it can be merged.
Comment 19 Jan Schmidt 2016-03-07 13:35:46 UTC
Created attachment 323272 [details] [review]
subparse: WebVTT parsing support

WebVTT is a new subtitle format for HTML5 video. In this first
version of the parser the cue settings are parsed but only stored in
the internal parser state structure. Later on these settings could be
part of the GstBuffer metadata.
Comment 20 Jan Schmidt 2016-03-07 13:38:16 UTC
Updated version that works with git master. It needs more work to actually pass annotations and support all attributes in the subtitle renderer.
Comment 21 Sebastian Dröge (slomo) 2016-03-08 07:41:29 UTC
Let's get this in after 1.8 then, once it's merged it can still be improved.
Comment 22 Jan Schmidt 2016-03-24 14:26:26 UTC
Comment on attachment 323272 [details] [review]
subparse: WebVTT parsing support

Committed this initial patch. Should we keep this bug open for enhancements?
Comment 23 Tim-Philipp Müller 2016-03-24 16:44:45 UTC
Up to you, I'd file new bugs for specific enhancements, unless you're planning on finishing off those other bits anyway. New bugs are clearer and more actionable :)
Comment 24 Carlos Rafael Giani 2016-03-24 16:50:44 UTC
I'd close this instead. WebVTT is .. big. With tons of features. It makes more sense to add some on request (= new bugzilla entries).
Comment 25 Sebastian Dröge (slomo) 2016-03-25 08:44:11 UTC
Additional bugs are better to manage, yes.