Skip to main content
Skip table of contents

Subtitles reference [VC 21.3.1 GEN]

Vidispine is able to produce SCC and TTML files from given subtitle metadata on items.

Exporting subtitles

Export to SCC

GET /item/(id)/metadata/export/scc

Returns the subtitles from the item metadata in SCC format.

Query Parameters:
  • interval (string) – Comma-separated list of time spans of subtitle metadata to export. Default is all, meaning all subtitles.

Produces:
  • text/plain – The SCC data.

Role:

_metadata_read

Example

NONE
PUT /item/VX-52/metadata/
HTML/XML
<?xml version="1.0"?>
<MetadataDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <timespan start="10" end="20">
    <group>
      <name>stl_subtitle</name>
      <field>
        <name>stl_text</name>
        <value>Text</value>
      </field>
    </group>
  </timespan>
</MetadataDocument>
NONE
GET /item/VX-56/metadata/export/scc
PYTHON
Scenarist_SCC V1.0

00:00:00:00  942c 942c 9420 9420 9470 9470 54e5 f8f4

00:00:10:00  942f 942f

00:00:20:00  942c 942c

Export to TTML

GET /item/(id)/metadata/export/ttml

Generates a TTML file containing the subtitle metadata from a specific item.

The output TTML file obeys EBU-TT standard (EBU Tech 3360)

An optional offset can be applied to the time span by adding “:” and the offset.

Query Parameters:
  • interval (string) – Comma-separated list of time spans of subtitle metadata to export. Default is all, meaning all subtitles.

Produces:
  • application/xml – The TTML XML.

Role:

_metadata_read

Example

Firstly, import an STL file as a sidecar file

NONE
POST /import/sidecar/{item-id}?sidecar=subtitle.stl

Then export the STL metadata to TTML:

NONE
GET /item/{id}/metadata/export/ttml

Example result:

HTML/XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<tt xmlns:ns2="http://www.w3.org/ns/ttml#styling" xmlns="http://www.w3.org/ns/ttml" xmlns:ns4="http://www.w3.org/ns/ttml#metadata" xmlns:ns3="urn:ebu:tt:style" xmlns:ns5="http://www.w3.org/ns/ttml#parameter" xmlns:ns6="urn:ebu:tt:metadata" ns5:frameRate="25" ns5:cellResolution="50 30" ns2:extent="704px 576px" xml:lang="en">
  <head>
    <metadata>
      <ns6:documentMetadata>
        <ns6:documentTargetAspectRatio>4:3</ns6:documentTargetAspectRatio>
        <ns6:documentTotalNumberOfSubtitles>11</ns6:documentTotalNumberOfSubtitles>
        <ns6:documentMaximumNumberOfDisplayableCharacterInAnyRow>40</ns6:documentMaximumNumberOfDisplayableCharacterInAnyRow>
        <ns6:documentStartOfProgramme>00:00:00:00</ns6:documentStartOfProgramme>
        <ns6:documentCountryOfOrigin>GB</ns6:documentCountryOfOrigin>
        <ns6:documentPublisher>Institut fuer Rundfunktechnik   </ns6:documentPublisher>
      </ns6:documentMetadata>
    </metadata>
    <styling>
      <style xml:id="textCenter" ns2:textAlign="center"/>
      <style xml:id="defaultStyle" ns2:fontFamily="monospaceSansSerif" ns2:fontSize="1c 1c" ns2:lineHeight="normal" ns2:textAlign="center" ns2:color="white" ns2:backgroundColor="transparent" ns2:fontStyle="normal" ns2:fontWeight="normal" ns2:textDecoration="none"/>
      <style xml:id="whiteOnblackDH" ns2:fontSize="1c 2c" ns2:color="white" ns2:backgroundColor="black"/>
    </styling>
    <layout>
      <region xml:id="bottom" ns2:origin="10% 10%" ns2:extent="80% 80%" ns2:displayAlign="after" ns2:padding="0c" ns2:writingMode="lrtb"/>
      <region xml:id="top" ns2:origin="10% 10%" ns2:extent="80% 80%" ns2:displayAlign="before" ns2:padding="0c" ns2:writingMode="lrtb"/>
    </layout>
  </head>
  <body>
    <div xml:id="SGN1" style="defaultStyle">
      <p region="top" style="textCenter" begin="00:00:00:00" end="00:00:02:10">
        <br/>
        <span style="whiteOnblackDH">two-line</span>
        <br/>
        <span style="whiteOnblackDH">top</span>
      </p>
      <p region="top" style="textCenter" begin="00:00:02:14" end="00:00:04:21">
        <br/>
        <span style="whiteOnblackDH">one-line top</span>
      </p>
      <p region="bottom" style="textCenter" begin="00:00:05:00" end="00:00:07:05">
        <span style="whiteOnblackDH">two-line</span>
        <br/>
        <span style="whiteOnblackDH">centre</span>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
      </p>
      <p region="bottom" style="textCenter" begin="00:00:07:09" end="00:00:10:19">
        <span style="whiteOnblackDH">one-line centre</span>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
      </p>
      <p region="bottom" style="textCenter" begin="00:00:14:06" end="00:00:17:10">
        <span style="whiteOnblackDH">two-line</span>
        <br/>
        <span style="whiteOnblackDH">bottom</span>
      </p>
      <p region="bottom" style="textCenter" begin="00:00:10:23" end="00:00:14:02">
        <span style="whiteOnblackDH">three-line</span>
        <br/>
        <span style="whiteOnblackDH">subtitle</span>
        <br/>
        <span style="whiteOnblackDH">bottom</span>
      </p>
      <p region="bottom" style="textCenter" begin="00:00:17:14" end="00:00:19:19">
        <span style="whiteOnblackDH">one-line bottom</span>
      </p>
      <p region="bottom" style="textCenter" begin="00:00:20:23" end="00:00:23:24">
        <span style="whiteOnblackDH">two-line subtitle</span>
        <br/>
        <span style="whiteOnblackDH">on row 16</span>
        <br/>
        <br/>
        <br/>
        <br/>
      </p>
      <p region="bottom" style="textCenter" begin="00:00:23:07" end="00:00:25:12">
        <span style="whiteOnblackDH">one-line row 18</span>
        <br/>
        <br/>
        <br/>
        <br/>
      </p>
      <p region="top" style="textCenter" begin="00:00:26:12" end="00:00:29:10">
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <span style="whiteOnblackDH">two-line subtitle</span>
        <br/>
        <span style="whiteOnblackDH">on row 5</span>
      </p>
      <p region="top" style="textCenter" begin="00:00:28:21" end="00:00:31:01">
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <span style="whiteOnblackDH"> one-line on row 5</span>
      </p>
    </div>
  </body>
</tt>

Only export the part of STL metadata to TTML:

NONE
GET /item/{id}/metadata/export/ttml?interval=905207@PAL-905253@PAL,904994@PAL-905065@PAL

It is also possible to apply different offsets to the exported time intervals:

NONE
GET /item/{id}/metadata/export/ttml?interval=100@PAL-250@PAL:-25@PAL,500@PAL-1000@PAL:-250@PAL
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.