GNOME Bugzilla – Bug 629764
subparse: Add WebVTT support
Last modified: 2016-03-25 08:44:11 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/
adding me in CC
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.
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.
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).
For now it would also be great to have something that works with GStreamer 0.10
(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 < 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?
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
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.
*** Bug 629670 has been marked as a duplicate of this bug. ***
Is that working with 1.0, is there a newer version of this already?
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 :)
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?
I'll have some time this week for this. About the cue settings, do we still want to store them as metadata?
What exactly are the cue settings?
They're specified in http://dev.w3.org/html5/webvtt/#dfn-webvtt-cue-settings
Can't they be converted to pango markup? Who would handle that metadata?
What is the status of this? I have an immediate need for WebVTT support. What is missing?
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.
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.
Updated version that works with git master. It needs more work to actually pass annotations and support all attributes in the subtitle renderer.
Let's get this in after 1.8 then, once it's merged it can still be improved.
Comment on attachment 323272 [details] [review] subparse: WebVTT parsing support Committed this initial patch. Should we keep this bug open for enhancements?
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 :)
I'd close this instead. WebVTT is .. big. With tons of features. It makes more sense to add some on request (= new bugzilla entries).
Additional bugs are better to manage, yes.