Ever wondered how to hardcode
.srt subtitles into a video?
Or how to modify the font size before fusing them?
This tutorial will show you how to do that.
For the process to be successful, we need the
.srt file to be UTF-8 encoded.
Spanish subtitles files are commonly encoded as ISO-8859-1.
So, is it ISO-8859-1 or UTF-8?
Find out with:
If it’s UTF-8 encoded, you’ll see something like:
some.srt: UTF-8 Unicode text, with CRLF line terminators
If it’s ISO-8859-1 it’d be:
some.srt: ISO-8859 text, with CRLF line terminators
To convert an
.srt file from ISO-8859-1 encoding to UTF-8, use:
iconv -f ISO-8859-1 -t UTF-8 some.srt >> utf8.srt
Now your UTF-8 encoded subs will be in the
Let’s suppose your subtitleless video file is called
To merge the .srt and the .mp4 files together, type:
ffmpeg -i video.mp4 -vf subtitles=utf8.srt video-with-subs.mp4
The downside to using a pure
.srt file, is that you cannot format the subtitles.
That’s why it’s better to convert them to
ffmpeg -i utf8.srt subs.ass
To format the subtitles, just open the
.ass file in a text editor and modify
the font size, etc.
Then hardcode the subtitles with:
ffmpeg -i video.mp4 -vf ass=subs.ass video-with-subs.mp4
P.S. The process is CPU intensive and uses all the cores available, so the more you have the better!
Get in touch on Twitter
Or by good ol' email at