Using youtube-dl --write-auto-sub we get a file like this:
WEBVTT
Kind: captions
Language: en
Style:
::cue(c.colorCCCCCC) { color: rgb(204,204,204);
}
::cue(c.colorE5E5E5) { color: rgb(229,229,229);
}
##
00:00:00.030 --> 00:00:02.619 align:start position:0%
<c.colorE5E5E5>because<00:00:00.630><c> then</c><00:00:00.780><c> media</c><00:00:01.079><c> tries</c><00:00:01.380><c> to</c><00:00:01.589><c> sell</c><00:00:01.800><c> chips</c></c><c.colorCCCCCC><00:00:02.129><c> a</c></c>
00:00:02.619 --> 00:00:02.629 align:start position:0%
<c.colorE5E5E5>because then media tries to sell chips</c><c.colorCCCCCC> a
</c>
00:00:02.629 --> 00:00:05.869 align:start position:0%
<c.colorE5E5E5>because then media tries to sell chips</c><c.colorCCCCCC> a
lot<00:00:03.629><c> of</c><00:00:03.870><c> chips</c></c><c.colorE5E5E5><00:00:04.200><c> into</c></c><c.colorCCCCCC><00:00:04.560><c> the</c></c><c.colorE5E5E5><00:00:04.890><c> Android</c><00:00:05.279><c> Market</c><00:00:05.700><c> and</c></c>
00:00:05.869 --> 00:00:05.879 align:start position:0%
lot of chips<c.colorE5E5E5> into</c><c.colorCCCCCC> the</c><c.colorE5E5E5> Android Market and
</c>
00:00:05.879 --> 00:00:08.900 align:start position:0%
lot of chips<c.colorE5E5E5> into</c><c.colorCCCCCC> the</c><c.colorE5E5E5> Android Market and
NVIDIA</c><c.colorCCCCCC><00:00:06.600><c> has</c></c><c.colorE5E5E5><00:00:06.839><c> been</c><00:00:07.109><c> the</c><00:00:07.350><c> single</c><00:00:07.980><c> worst</c><00:00:08.280><c> company</c></c>
00:00:08.900 --> 00:00:08.910 align:start position:0%
NVIDIA<c.colorCCCCCC> has</c><c.colorE5E5E5> been the single worst company
</c>
00:00:08.910 --> 00:00:14.420 align:start position:0%
NVIDIA<c.colorCCCCCC> has</c><c.colorE5E5E5> been the single worst company
we've<00:00:09.090><c> ever</c><00:00:09.389><c> dealt</c><00:00:09.719><c> with</c><00:00:09.870><c> so</c><00:00:10.620><c> Nvidia</c><00:00:11.090><c> fuck</c><00:00:12.090><c> you</c></c>
webvtt-py can be used to extract the color and timing information, but why does Youtube generate repeated captions? And what is the best way to get the plaintext caption? I've tried ignoring all captions that are 0.010 seconds long but there are still overlapping lines (that is, the text in the end of one line overlaps with the text in the beginning of the next line).
Related
I have document in the following format:
<root>
<part>
<chapter>
<section>
<chapter>
<section>
<part2>
<chapter>
<section>
<chapter>
<section>
I am trying to number the section. I am using the following code:
<xsl:number format="1.1.1" level="multiple" count="chapter|section"/>
The issue I am facing is that it is resetting the chapter number in each part. While I want to have continuous chapter numbers irrespective of the Part.
When I try to use FAVOURITE GAME as keyword in AIML v2 (using Pandorabots) I get matches from * category, but not favourite game category. I have no idea what can be wrong.
For example for favourite game I get:
Sorry, could you repeat in an other way?
<aiml>
<!--POWITANIE-->
<category>
<pattern>HI #</pattern>
<template>
<random>
<li>Yo!</li>
<li>Hello!</li>
<li>Welcome to my chatroom man</li>
<li>Hi</li>
<li>Nice to meet you, I'm Alfred</li>
</random>
</template>
</category>
<!--ULUBIONA GRA-->
<category>
<pattern># FAVOURITE # GAME #</pattern>
<template> My favourite game is Starcraft2, and your? </template>
</category>
<!--NA BEZSENSOWNY INPUT-->
<category>
<pattern>*</pattern>
<template>
<random>
<li>I have no idea what to say to you.</li>
<li>I don't understand you.</li>
<li>Sorry, could you repeat in an other way?</li>
</random>
</template>
</category>
</aiml>
If you say, "FAVORITE GAME" to your bot (without the U), I would strongly suspect the category would work. By default, the normal.substitution file for your bot will contain this entry:
["favourite", "favorite"],
This means that whenever anyone says, "FAVOURITE", the bot thinks you mean, "FAVORITE".
If you remove this entry, your bot will recognise "favourite" instead of "favorite" and your pattern will match.
I have a dita XML with the following structure.
<bookmap>
<frontmatter><!-- FM content --></frontmatter>
<concept><!-- chapter content --></concept>
<concept><!-- chapter content --></concept>
<concept><!-- chapter content --></concept>
<concept><!-- chapter content --></concept>
<concept><!-- chapter content --></concept>
<concept><!-- chapter content --></concept>
<concept><!-- chapter content --></concept>
<concept><!-- chapter content --></concept>
</bookmap>
I need to have different header for only first page of first level the others are normal.
I used dita to pdf pluing static content for first page
<fo:static-content flow-name="first-body-header">
<fo:block xsl:use-attribute-sets="__body__odd__header">
<xsl:call-template name="getVariable">
<xsl:with-param name="id" select="'Body odd header'"/>
<xsl:with-param name="params">
<!-- <prodname>
<xsl:value-of select="$productName"/>
</prodname>-->
<heading>
<fo:inline xsl:use-attribute-sets="__body__odd__header__heading">
<fo:retrieve-marker retrieve-class-name="current-header"/>
</fo:inline>
</heading>
</xsl:with-param>
</xsl:call-template>
</fo:block>
</fo:static-content>
</xsl:template>
Unfortunately this template applies to all the first pages of all
parts.
Have anyone faced this issue before. I want this header to be applicable only first page of first level
Thanks in advance
Arul
I am not sure about dita, but this issue is #8.5 under (Apache's) XSL-FO FAQ, and can be achieved (with fo resources) by something like:
<?xml version="1.0"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<!-- layout master set: -->
<fo:layout-master-set>
<!-- page master for 1st page -->
<!-- define a (e.g.) A4 page-master with extra 20mm header region for the first page -->
<fo:simple-page-master master-name="myFirst"
page-height="297mm" page-width="210mm"
margin-top="20mm" margin-bottom="20mm"
margin-left="25mm" margin-right="25mm">
<fo:region-body margin-top="20mm"/>
<fo:region-before region-name="myHeaderFirst" extent="20mm"/>
<!-- define custom footer with <fo:region-after/> ... -->
</fo:simple-page-master>
<!-- page master for "rest" page (body only) -->
<fo:simple-page-master master-name="myRest"
page-height="297mm" page-width="210mm"
margin-top="20mm" margin-bottom="20mm"
margin-left="25mm" margin-right="25mm">
<!-- define only/same body -->
<fo:region-body/>
</fo:simple-page-master>
<!-- Da page seekwendz masta! ..combining myFirst and myRest ;) -->
<fo:page-sequence-master master-name="myDocument">
<fo:repeatable-page-master-alternatives>
<!-- here comes fo magic: "page-position" in (first|last|rest|any|only)
..with precedence! -->
<fo:conditional-page-master-reference page-position="first"
master-reference="myFirst"/>
<fo:conditional-page-master-reference page-position="rest"
master-reference="myRest"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<!-- here go the contents/page sequences ... -->
<fo:page-sequence master-reference="myDocument">
<!-- static content BEFORE flow! (a small pitfall,
esp. when it is the footer not the header:)) -->
<fo:static-content flow-name="myHeaderFirst">
TODO : "print" your header for first page here.
</fo:static-content>
<!-- define other/more static-contents ... -->
<fo:flow flow-name="xsl-region-body">
TODO : "print" flow/body.
<!-- xsl:applyTemplates /-->
</fo:flow>
</fo:page-sequence>
</fo:root>
https://xmlgraphics.apache.org/fop (apache's fo-impl home)
https://www.data2type.de/en/xml-xslt-xslfo/xsl-fo/ (very detailed documentation on xsl-fo in en + de language)
I am trying to build a website that plays mp3. I am using:
jPlayer : For client side audio player.
icecast : For streaming mp3 audio.
Other technologies are ruby on rails, nginx, angularjs etc.
My Problem is:
jPlayer fully load the song then it start playing
So starting the song is always delayed based on song file size.
Other findings:
Byte rang request is working. But still loading the full song first.
My icecast.xml file is as following:
<icecast>
<!-- location and admin are two arbitrary strings that are e.g. visible
on the server info page of the icecast web interface
(server_version.xsl). -->
<location>Earth</location>
<admin>admin#playstore.com</admin>
<!-- IMPORTANT!
Especially for inexperienced users:
Start out by ONLY changing all passwords and restarting Icecast.
For detailed setup instructions please refer to the documentation.
It's also available here: http://icecast.org/docs/
-->
<limits>
<clients>100</clients>
<sources>2</sources>
<queue-size>2048</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<!-- If enabled, this will provide a burst of data when a client
first connects, thereby significantly reducing the startup
time for listeners that do substantial buffering. However,
it also significantly increases latency between the source
client and listening client. For low-latency setups, you
might want to disable this. -->
<burst-on-connect>0</burst-on-connect>
<!-- same as burst-on-connect, but this allows for being more
specific on how much to burst. Most people won't need to
change from the default 64k. Applies to all mountpoints -->
<burst-size>512</burst-size>
</limits>
<authentication>
<!-- Sources log in with username 'source' -->
<source-password>irfan</source-password>
<!-- Relays log in with username 'relay' -->
<relay-password>passw0rd</relay-password>
<!-- Admin logs in with the username given below -->
<admin-user>admin</admin-user>
<admin-password>passw0rd</admin-password>
</authentication>
<!-- set the mountpoint for a shoutcast source to use, the default if not
specified is /stream but you can change it here if an alternative is
wanted or an extension is required
<shoutcast-mount>/live.nsv</shoutcast-mount>
-->
<!-- Uncomment this if you want directory listings -->
<!--
<directory>
<yp-url-timeout>15</yp-url-timeout>
<yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
</directory>
-->
<!-- This is the hostname other people will use to connect to your server.
It affects mainly the urls generated by Icecast for playlists and yp
listings. You MUST configure it properly for YP listings to work!
-->
<hostname>localhost</hostname>
<!-- You may have multiple <listener> elements -->
<listen-socket>
<port>8000</port>
<bind-address>127.0.0.1</bind-address>
<shoutcast-mount>/stream</shoutcast-mount>
</listen-socket>
<!--
<listen-socket>
<port>8090</port>
</listen-socket>
-->
<!--
<listen-socket>
<port>8443</port>
<ssl>1</ssl>
</listen-socket>
-->
<!-- Global header settings
Headers defined here will be returned for every HTTP request to Icecast.
The ACAO header makes Icecast public content/API by default
This will make streams easier embeddable (some HTML5 functionality needs it).
Also it allows direct access to e.g. /status-json.xsl from other sites.
If you don't want this, comment out the following line or read up on CORS.
-->
<http-headers>
<header name="Access-Control-Allow-Origin" value="*" />
</http-headers>
<!-- Relaying
You don't need this if you only have one server.
Please refer to the config for a detailed explanation.
-->
<!--<master-server>127.0.0.1</master-server>-->
<!--<master-server-port>8001</master-server-port>-->
<!--<master-update-interval>120</master-update-interval>-->
<!--<master-password>hackme</master-password>-->
<!-- setting this makes all relays on-demand unless overridden, this is
useful for master relays which do not have <relay> definitions here.
The default is 0 -->
<!--<relays-on-demand>1</relays-on-demand>-->
<!--
<relay>
<server>127.0.0.1</server>
<port>8080</port>
<mount>/example.ogg</mount>
<local-mount>/different.ogg</local-mount>
<on-demand>0</on-demand>
<relay-shoutcast-metadata>0</relay-shoutcast-metadata>
</relay>
-->
<!-- Mountpoints
Only define <mount> sections if you want to use advanced options,
like alternative usernames or passwords
-->
<!-- Default settings for all mounts that don't have a specific <mount type="normal">.
-->
<!--
<mount type="default">
<public>0</public>
<intro>/server-wide-intro.ogg</intro>
<max-listener-duration>3600</max-listener-duration>
<authentication type="url">
<option name="mount_add" value="http://auth.example.org/stream_start.php"/>
</authentication>
<http-headers>
<header name="foo" value="bar" />
</http-headers>
</mount>
-->
<!-- Normal mounts -->
<!--
<mount type="normal">
<mount-name>/example-complex.ogg</mount-name>
<username>othersource</username>
<password>hackmemore</password>
<max-listeners>1</max-listeners>
<dump-file>/tmp/dump-example1.ogg</dump-file>
<burst-size>65536</burst-size>
<fallback-mount>/example2.ogg</fallback-mount>
<fallback-override>1</fallback-override>
<fallback-when-full>1</fallback-when-full>
<intro>/example_intro.ogg</intro>
<hidden>1</hidden>
<public>1</public>
<authentication type="htpasswd">
<option name="filename" value="myauth"/>
<option name="allow_duplicate_users" value="0"/>
</authentication>
<http-headers>
<header name="Access-Control-Allow-Origin" value="http://webplayer.example.org" />
<header name="baz" value="quux" />
</http-headers>
<on-connect>/home/icecast/bin/stream-start</on-connect>
<on-disconnect>/home/icecast/bin/stream-stop</on-disconnect>
</mount>
-->
<!--
<mount type="normal">
<mount-name>/auth_example.ogg</mount-name>
<authentication type="url">
<option name="mount_add" value="http://myauthserver.net/notify_mount.php"/>
<option name="mount_remove" value="http://myauthserver.net/notify_mount.php"/>
<option name="listener_add" value="http://myauthserver.net/notify_listener.php"/>
<option name="listener_remove" value="http://myauthserver.net/notify_listener.php"/>
<option name="headers" value="x-pragma,x-token"/>
<option name="header_prefix" value="ClientHeader."/>
</authentication>
</mount>
-->
<fileserve>1</fileserve>
<paths>
<!-- basedir is only used if chroot is enabled -->
<basedir>/usr/local/Cellar/icecast/2.4.2/share/icecast</basedir>
<!-- Note that if <chroot> is turned on below, these paths must both
be relative to the new root, not the original root -->
<logdir>/usr/local/Cellar/icecast/2.4.2/var/log/icecast</logdir>
<webroot>/usr/local/Cellar/icecast/2.4.2/share/icecast/web</webroot>
<adminroot>/usr/local/Cellar/icecast/2.4.2/share/icecast/admin</adminroot>
<!-- <pidfile>/usr/local/Cellar/icecast/2.4.2/share/icecast/icecast.pid</pidfile> -->
<!-- Aliases: treat requests for 'source' path as being for 'dest' path
May be made specific to a port or bound address using the "port"
and "bind-address" attributes.
-->
<!--
<alias source="/foo" destination="/bar"/>
-->
<!-- Aliases: can also be used for simple redirections as well,
this example will redirect all requests for http://server:port/ to
the status page
-->
<alias source="/" destination="/status.xsl"/>
<!-- The certificate file needs to contain both public and private part.
Both should be PEM encoded.
<ssl-certificate>/usr/local/Cellar/icecast/2.4.2/share/icecast/icecast.pem</ssl-certificate>
-->
</paths>
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<!-- <playlistlog>playlist.log</playlistlog> -->
<loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
<logsize>10000</logsize> <!-- Max size of a logfile -->
<!-- If logarchive is enabled (1), then when logsize is reached
the logfile will be moved to [error|access|playlist].log.DATESTAMP,
otherwise it will be moved to [error|access|playlist].log.old.
Default is non-archive mode (i.e. overwrite)
-->
<!-- <logarchive>1</logarchive> -->
</logging>
<security>
<chroot>0</chroot>
<!--
<changeowner>
<user>nobody</user>
<group>nogroup</group>
</changeowner>
-->
</security>
I need to understand how should I can do something that player will start playing the song after loading the very small amount of song to prevent starting delayed.
I finally solved it! I found chrome have the problem and it can't start an mp3 encoded music file while loading. But it can play immediately the other supported encoded music. Well this is not a permanent solution. But in my case, encoding all songs for fallback support gives me the trick. Now all major browsers are playing songs successfully.
Am publishing an app for iPad with Flash cc, air 4.0.
Problem: I need to include 2 high-res icons, 76x76 and 152x152.
But, nowhere on the Flash publish settings (under the icons tab) do I see a way to add those files. Still, Apple is giving me hassle about them.
Does anyone know how to add those extra icons, what to name them, where to put them so that when they are bundled in the IPA, they are included?
Thanks!!
This is my descriptor file ("cannot be parsed" error): Maybe I'm putting the two new icons in the wrong place in my code?? This is the whole descriptor file:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<application xmlns="http://ns.adobe.com/air/application/4.0">
<id>com.theapptrain.tpvision</id>
<versionNumber>1.0</versionNumber>
<filename>Hospitality TV</filename>
<description></description>
<!-- To localize the description, use the following format for the description element.
<description>
<text xml:lang="en">English App description goes here</text>
<text xml:lang="fr">French App description goes here</text>
<text xml:lang="ja">Japanese App description goes here</text>
</description>
-->
<name>Hospitality TV</name>
<!-- To localize the name, use the following format for the name element.
<name>
<text xml:lang="en">English App name goes here</text>
<text xml:lang="fr">French App name goes here</text>
<text xml:lang="ja">Japanese App name goes here</text>
</name>
-->
<copyright></copyright>
<initialWindow>
<content>TPVisionApp.swf</content>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
<fullScreen>true</fullScreen>
<autoOrients>false</autoOrients>
<aspectRatio>landscape</aspectRatio>
<renderMode>auto</renderMode>
</initialWindow>
<customUpdateUI>false</customUpdateUI>
<allowBrowserInvocation>false</allowBrowserInvocation>
<icon>
<image29x29>icons/tpvision29x29.png</image29x29>
<image57x57>icons/tpvision57x57.png</image57x57>
<image114x114>icons/tpvision114x114.png</image114x114>
<image512x512>icons/tpvision512x512.png</image512x512>
<image48x48>icons/tpvision48x48.png</image48x48>
<image72x72>icons/tpvision72x72.png</image72x72>
<image76x76>icons/tpvision76x76.png</image76x76>
<image50x50>icons/tpvision50x50.png</image50x50>
<image58x58>icons/tpvision58x58.png</image58x58>
<image100x100>icons/tpvision100x100.png</image100x100>
<image144x144>icons/tpvision144x144.png</image144x144>
<image152x152>icons/tpvision152x152.png</image152x152>
<image1024x1024>icons/tpvision1024x1024.png</image1024x1024>
</icon>
<supportedLanguages>en</supportedLanguages>
<iPhone>
<requestedDisplayResolution>high</requestedDisplayResolution>
<InfoAdditions><![CDATA[
<key>UIDeviceFamily</key>
<array><string>2</string></array>
]]></InfoAdditions>
</iPhone>
<version>1.0</version>
</application>
You might want to take a look here: http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac1e63e3d129907d2886-8000.htmlI used to build my apps via flash too and I always entered the icons in the application description file as described on the linked site.