kdenlive to mmg/mkv and bombono

revision 51b1afee84127a759671e643baaab4c21a3b174f

raw

README.rst

XSLT files to convert kdenlive files to mkv chapters for mmg (mkvmerge gui), and to DVD chapters (bombono).

raw

kdenlive-to-bombono-parts.xsl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output indent="yes"/>
 
 <xsl:template match="/">
  <Parts>
      <xsl:for-each select="mlt/kdenlivedoc/guides/guide">
        <!-- support german files with comma as decimal separator-->
        <xsl:variable name="time" select="translate(@time,',','.')"/>
        <Part Name="{@comment}"><xsl:value-of select="$time"/></Part>
      </xsl:for-each>
  </Parts>
 </xsl:template>
 
</xsl:stylesheet> 
 
raw

kdenlive-to-mkv-chapters.xsl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output indent="yes"/>
 
 <xsl:template match="/">
  <Chapters>
   <EditionEntry>
      <!--<xsl:for-each select="mlt/kdenlivedoc/markers/marker">-->
      <xsl:for-each select="mlt/kdenlivedoc/guides/guide">
        <!-- support german files with comma as decimal separator-->
        <xsl:variable name="time" select="translate(@time,',','.')"/>
 
        <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:if test="@comment!='Hilfslinie'">
                <xsl:value-of select="@comment"/>
              </xsl:if>
            </ChapterString>
            <ChapterLanguage>ger</ChapterLanguage>
          </ChapterDisplay>
          <ChapterFlagHidden>
            <xsl:choose>
              <xsl:when test="@comment='Hilfslinie'">1</xsl:when>
              <xsl:otherwise>0</xsl:otherwise>
            </xsl:choose>
          </ChapterFlagHidden>
          <ChapterFlagEnabled>1</ChapterFlagEnabled>
          <ChapterTimeStart>
            <xsl:value-of select="$timecode"/>
          </ChapterTimeStart>
        </ChapterAtom>
      </xsl:for-each>
 
   </EditionEntry>
  </Chapters>
 </xsl:template>
 
</xsl:stylesheet> 
 

History