Created
July 3, 2017 21:19
-
-
Save ttsuki/9faa88e1d3aad2b474ab78c1ba4fabe0 to your computer and use it in GitHub Desktop.
mkvextract chapters "hogefugapiyo.mkv" | xsltproc mkv2cue.xslt -
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="Shift_JIS"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:output method="text" encoding="Shift_JIS"/> | |
<xsl:template match="/"> | |
<xsl:text>FILE "alltrack.wav" WAVE
</xsl:text> | |
<xsl:apply-templates select="//ChapterAtom" /> | |
</xsl:template> | |
<xsl:template match="ChapterAtom"> | |
<xsl:text> TRACK </xsl:text><xsl:value-of select="format-number(count(preceding-sibling::ChapterAtom) + 1, '00')" /><xsl:text>
</xsl:text> | |
<xsl:text> TITLE "</xsl:text><xsl:value-of select="ChapterDisplay/ChapterString" /><xsl:text>"
</xsl:text> | |
<xsl:text> INDEX 01 </xsl:text><xsl:value-of select="format-number(number(substring(ChapterTimeStart, 1, 2)) * 60 + number(substring(ChapterTimeStart, 4, 2)), '00')"/> | |
<xsl:text>:</xsl:text> | |
<xsl:value-of select="substring(ChapterTimeStart, 7, 2)"/> | |
<xsl:text>:</xsl:text> | |
<xsl:value-of select="format-number(number('0' + substring(ChapterTimeStart, 9)) * 75, '00')"/> | |
<xsl:text>
</xsl:text> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment