Workaround for adding hardcoded subtitles in ShotCut?


I have read

Let’s say we have a webvtt or other format subtitle file. I have thought of following workaround to add hardcoded subtitles to videos.

  1. Use some other “tool” that takes the vtt or srt file as input and creates a transparent / greenscreen video with subtitles being shown according to the timing in srt/vtt file.

  2. Next, add this video in second video track in ShotCut, and remove greenscreen.

Trouble is, I don’t know which tool I could use for step1. Please suggest such a tool (preferably free).

Or if you have a better workaround to add hardcoded subtitles from srt/vtt files to video, please let me know.


Check out the link below which involves a few people discussing the same problem and offers a few solutions.


Excellent! That does the job i think. Now the only thing remaining is how to export that video from Aegisub. If there is a better workaround than using a screen recording software, please let us know.


I can’t help you there I’m afraid, but I did just find another player you might want to look at.


This is an interesting project

I will look into modifying my WebVfx framework to enable subtitles in “srt” or “vtt” to be easily incorporated into a video using it. Hopefully I’ll be able to get a working version created sometime during this coming week - I’ll let you know when it’s available.


You could create a green or blue screen video, then use Handbrake to hard-code the subtitles to the video.


There is a filter in the engine that can help, but there is an issue with respect to trying to “cut” the subtitle:

Still, this might be a useful filter for some use cases.


@ravenclaw, @berni, @stanglow, @nwgat, @jonray, @sauron, @qdsov,

I have modified my WebVfx framework to enable subtitles (in Subrip .srt file format) to be hardcoded onto videos using the Overlay HTML feature (see: WebVfx HTML Overlay Filters Update - Slideshows, Exploding Text). This is version 1.5 of the framework.

I tried several ways of reading an .srt file in javascript, but although some of them worked in the browser, none of them worked in Shotcut itself. So the contents of the .srt file have to be copied into a <pre></pre> tag in the HTML itself. See below and the example on the website:

If you apply the subtitle to a video and then edit that video (e.g. by deleting a clip) then of course the subtitle cues will no longer match up to the speech on the video. You will either have to recreate the .srt file anew, or use a Subrip editor to edit the cues (see the documentation on my website). Another possibility would be to create a video with just the subtitles on it, then use this as a second track in Shotcut and whenever you cut the main track you would do an identical cut to the subtitle track.

You can use CSS to position and style the subtitle in whatever way you want. The example on the website shows two copies of the subtitles, the one at the top of the screen in white on a semitransparent dark background, while the one at the bottom of the screen is in white with a dark outline on a totally transparent background.

The basic HTML to create the example is:

<body data-control='40:30'>
	The subtitles appear at the top (#srt1) of the screen and also at the bottom (#srt2).
	<div id='st1' class='webvfx' data-subtitles='subtitles'></div>
	<div id='st2' class='webvfx' data-subtitles='subtitles'></div>
	<pre id='subtitles'>
00:00:04,000 --> 00:00:15,400
This is the 1st subtitle 04sec to 15.4sec
Mary had a little lamb,
its <i>fleece</i> was white as snow
and everywhere that Mary went
that <b>lamb</b> was sure to go!

00:00:16,600 --> 00:00:25,800
This is the 2nd subtitle 16.6sec to 25.8sec

00:00:20,600 --> 00:00:23,800
This is the 3rd subtitle 20.6sec to 23.8sec

00:00:24,600 --> 00:00:30,800
This is the 4th subtitle 24.6sec to 30.8sec


Have a play with the source code on the website (including the CSS) and let me know what you think.

Bult-in subtitles (hardcoded/hardrendered)

Great stuff, Neil! I was thinking about adding subtitles to a 7-minute video featuring one of my songs, and I think this will help greatly, Will try to experiment when I can but the problem of lack of time has recurred. ( I’m just experimenting with applying the mask filter to text, inspired by sauron’s work. )

Will get to it when I can. Still haven’t got round to playing with your exploding text either…:tired_face:

Thank you for your brilliant work on this.


I tried the subtitles overlay with a video that I had subtitles for. The subtitles work but the first 4 lines of subtitles are showing on the left side of the video.

I tried an export and the 4 lines show in the export as well.

Is this a flaw in the code or did I mess up when I added my srt file to the code?