Document toolboxDocument toolbox

Vidispine

How to burn in subtitles to a video file

Before you can follow this guide, you should already have imported your subtitles to your Item.  You can read more about how to add subtitles to an Item here.

 

A sequence consists of a number of audio and/or video tracks, each with a number of segments. Each segment has a position in the timeline (in and out) and references a specific interval and track of an item. If you have a sequence attached to an item in Vidispine the subtitle metadata can be included in the output file. To do this, you need to use a shape tag where <burnSubtitles>true</burnSubtitles> is set in the <video> element. Note that overlapping subtitle timespans are not allowed and will cause the render job to fail.

 

Let’s say we have an item VX-811 which has a sequence attached to it, and the following metadata;

<MetadataDocument xmlns="http://xml.vidispine.com/schema/vidispine"> ... <timespan start="72140@PAL" end="72260@PAL"> <group> <name>stl_subtitle</name> <field><name>stl_justification</name><value>center</value></field> <field><name>stl_text</name><value>No, I am your father.</value></field> </group> </timespan> <timespan start="72320@PAL" end="72490@PAL"> <group> <name>stl_subtitle</name> <field><name>stl_justification</name><value>center</value></field> <field><name>stl_text</name><value>No... that's not true!&#13;&#10;That's impossible!</value></field> </group> </timespan> ... </MetadataDocument>

 

And we have the following shape-tag called MP4_512_SUB;

<TranscodePresetDocument xmlns="http://xml.vidispine.com/schema/vidispine"> <format>mp4</format> <audio> <codec>aac</codec> <bitrate>96000</bitrate> </audio> <video> <scaling> <width>512</width> <height>288</height> </scaling> <codec>h264</codec> <bitrate>2000000</bitrate> <framerate> <numerator>1</numerator> <denominator>25</denominator> </framerate> <burnSubtitles>true</burnSubtitles> </video> </TranscodePresetDocument>

 

Then a render job is started using:

POST /item/VX-811/sequence/render?tag=MP4_512_SUB <JobDocument xmlns="http://xml.vidispine.com/schema/vidispine"><jobId>VX-1436</jobId><user>admin</user><started>2013-03-08T13:02:15.654Z</started><status>READY</status><type>CONFORM</type><priority>MEDIUM</priority></JobDocument>

 

This will render the sequence and include any subtitle metadata as subtitles in the output video.