Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <Chapters>
- <EditionEntry>
- <xsl:for-each select="mlt/playlist/property[contains(@name, 'marker')]">
- <xsl:message>INSIDE MARKER</xsl:message>
- <xsl:variable name="step1" select="translate(@name, 'kdenlive:marker', '')"/>
- <xsl:variable name="time" select="substring($step1, 3, string-length($step1) - 3)"/>
- <xsl:variable name="seconds" select="$time mod 60" />
- <xsl:variable name="minutes" select="floor($time div 60) mod 60" />
- <xsl:variable name="hours" select="floor(($time div 60) div 60)" />
- <!-- hh:mm:ss.msec -->
- <xsl:variable name="timecode">
- <xsl:value-of select="format-number($hours, '00')"/>:<xsl:value-of select="format-number($minutes, '00')"/>:<xsl:value-of select="format-number($seconds, '00.000')"/>
- </xsl:variable>
- <ChapterAtom>
- <ChapterDisplay>
- <ChapterString>
- <xsl:value-of select="text()"/>
- </ChapterString>
- </ChapterDisplay>
- <ChapterFlagHidden>0</ChapterFlagHidden>
- <ChapterFlagEnabled>1</ChapterFlagEnabled>
- <ChapterTimeStart>
- <xsl:value-of select="$timecode"/>
- </ChapterTimeStart>
- </ChapterAtom>
- </xsl:for-each>
- </EditionEntry>
- </Chapters>
- </xsl:template>
- </xsl:stylesheet>
- xsltproc 4subs.xslt 4subs.kdenlive > chaps
- mkvmerge --chapters chaps -o cm2.mkv cm.mkv
Add Comment
Please, Sign In to add comment