Titles / Text

OpenShot Cloud API can add native text clips to a timeline and render titles from SVG templates.

Create Text

Open /projects/<id>/text/ in the browsable API and POST your text and style. This creates Text that you can reuse, with no physical media or timeline Clip. The response’s url identifies the new source through the existing /files/<id>/ API. It is ready to use; there is no media download or image upload to wait for.

Add it to the timeline with POST /projects/<id>/clips/: set file to that URL and supply position, start, end, and layer. Multiple Clips can use the same Text. New text Clips center the text box horizontally and vertically without stretching it. The primary fields are Text, Color, Size, Font, Position, and Line alignment. Font is a dropdown of the installed font families.

Font size defaults to 72 pixels. Font size, box dimensions, padding, and spacing use project pixels, so size 72 means 72 pixels at every project resolution. Set width to control wrapping and leave auto_height enabled to fit the text vertically. alignment controls lines inside the box. Position (gravity) chooses the starting anchor for new Clips, such as center, top-left, or bottom-right. Existing Clips retain their own placement; use normal Clip transforms to move them. Position anchors the text box, while Line alignment places the words inside it. With a box as wide as the project, left/right box anchors look the same; use Line alignment or a narrower width to change horizontal placement.

Use named fields such as font_name, font_size, bold, italic, color, stroke_color, and stroke_width. The endpoint reference lists all style fields. No comma-separated Qt font description is needed. The response’s json also contains direct_text for Desktop editing and native reader settings for rendering. These are generated automatically; edit the named API fields.

Edit the same fields with PATCH /files/<id>/. All Clips using that Text update, retaining their own timing, transforms, and animated style overrides. To change one instance’s wording independently, create separate Text and use it as that Clip’s source. Native text uses fonts installed on the API and render workers. The Font dropdown lists installed families and the default Sans Serif alias. Install the same fonts on API servers and render workers to avoid substitution.

Create an SVG Title

Use /projects/<id>/title/ to fill an SVG template and add the resulting File to your project. Then place the File on the timeline as a Clip. SVG templates are useful for titles that combine text with vector artwork.

Limitations with SVG Rendering

While most SVG properties are respected, some text effects and advanced properties are ignored. If you have an issue with rendering an SVG title, you might try simplifying it, or splitting your title up into multiple SVG files (and layering them using different File and Clip objects in OpenShot Cloud API).

SVG Files

We also recommend creating a template SVG file in a desktop vector program (such as Inkscape), with the font, text size, color, stroke, and fill already set. This is a simple text/XML file format, and can be modified easily by any programming language. Replace the text on your back-end for each title, and upload this as a new File in OpenShot Cloud API. Now you can add this file to your timeline as a Clip, and just make sure you place it on a track/layer above other clips, so it will appear on top.

Example SVG Contents

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" version="1.1" width="720" height="486" id="svg2985">
   <defs id="defs2987" />
   <g id="layer1">
      <text x="50.03632" y="273.45352" id="text2993" xml:space="preserve" style="font-size:155.10592651px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan x="50.03632" y="273.45352" id="tspan2995">My Title</tspan></text>
   </g>
</svg>
_images/title.png

Fonts

The installed fonts can be found at /usr/share/fonts, and OpenShot Cloud API includes many open-source fonts by default. You can retrieve all installed fonts with the /info/fonts/ endpoint.

To install a custom font, manually copy the file to /usr/share/fonts or POST font_file to /info/fonts/. Fonts are cached for performance reasons, so this might require a restart of your OpenShot Cloud API instance if you don’t see your new font listed, or any POST to /info/fonts/ endpoint will update the font cache.

You can also preview a JPEG thumbnail of all installed fonts with the /info/fonts/thumbnail/ endpoint.