Is there an android library which will parse/display an SMPTE Timed Text (captions) xml file? -
i retrieving smpte
timed text xml files remotely need parse , draw surface captions.
the full file format defined here:
https://www.smpte.org/sites/default/files/st2052-1-2010.pdf
the xml looks this:
<tt xmlns="http://www.w3.org/ns/ttml"> <head> ... </head> <body> <p begin="00:00:33:03" end="00:00:37:24" region="pop1" style="basic" tts:origin="20% 79.33%" tts:extent="60% 5.33%">it on little world,</p> <p begin="00:01:29:23" end="00:01:31:10" region="pop2" style="basic" tts:origin="30% 84.67%" tts:extent="50% 5.33%">giving instructions)</p> ... </body> </tt>
basically each p
tag defined time , position , text draw. haven't been able find native or third party libraries on android.
i'm looking library read xml file organized data structure of sort. there can handle drawing if need be.
any pointers helpful before start writing myself, taking account different arguments can become quite involved.
thankyou.
i able use simple library marshal following classes. setters , getters removed brevity. @ point code proof of concept, idea.
caption.java
// single caption display (from smpe-tt file) @root (name="p", strict=false) public class caption { @element (required = false, name = "font") private string caption; @attribute private string begin; @attribute private string end; @attribute (required = false) private string origin; @attribute (required = false) private string style; @attribute (required = false) private string space; }
timedtext.java
// class marshalling entire smpe-tt file @root (name="tt") public class timedtext { @attribute (required=false) private string lang; @element (required=false) private string head; @element (name = "body") private ttbody ttb; } class ttbody { @element (name = "div") private ttdiv ttd; } class ttdiv { @elementlist (inline = true) private list<caption> captionlist; }
Comments
Post a Comment