23

there is some formatting in srt subtitle files. for example

<i> blah blah blah </i> 

for italic or

<u> blah blah blah </u>

for underline or

<font color="color name"> ... </font>

for colorful text.

there is a code for moving the text up the screen instead of down. what is that code?

4 Answers 4

29

Many players support ASS tags in .srt files. Below is an example using ASS positioning tags which work in both VLC and SMplayer in Linux, and probably in many other players and other OSes.

Note that the accepted answer suggests an older version of the SSA format, using {\aX} instead of {\anX}. The numbers used in the older format are also different, and that format is considered deprecated. The newer format uses the numpad layout for the numbers. While SMplayer correctly displays both formats, VLC only accepts the current {\anX} format.

1
00:00:01,000 --> 00:00:04,000
{\an7} Top-left: an7

2
00:00:05,000 --> 00:00:08,000
{\an8}Top-center: an8

3
00:00:09,000 --> 00:00:12,000
{\an9}Top-right: an9

4
00:00:13,000 --> 00:00:16,000
{\an4}Middle-left: an4

5
00:00:17,000 --> 00:00:20,000
{\an5}Middle-center: an5

6
00:00:21,000 --> 00:00:24,000
{\an6}Middle-right: an6

7
00:00:25,000 --> 00:00:28,000
{\an1}Bottom-left: an1

8
00:00:29,000 --> 00:00:32,000
{\an2}Bottom-Center an2

9
00:00:33,000 --> 00:00:36,000
{\an3}Bottom-right: an3

11
00:00:37,000 --> 00:00:45,000
Back to default
1
  • Best answer. I can confirm this works.
    – sudo
    May 9, 2018 at 16:07
5

You must write {\an} before your text.

{\a10} for center of screen, {\a6} for center above, {\a5} for left above, {\a9} for left center, etc...

(if it doesn't work, copy my writing to your subtitle)

2
  • that's correct. I should also do the following to enable KM player to support that function: Preferences -> Subtitle processing -> Multi-sub/etc -> Advanced tab, enable the external subtitles module for .srt files. Jul 18, 2014 at 14:06
  • 2
    At least with VLC, the anchor tag is {\anX} (and not just '{\aX}') where X is 1,2,... and it counts from the bottom left to the top right, so {\an8} is top center, {\an1} is bottom left, etc.. The tags do not seem to be part of the srt format: en.wikipedia.org/wiki/SubRip There is also the positioning tags as mentioned by @Zerobinary99, though those don't seem to work in VLC. Jun 16, 2015 at 15:11
3

As far as I know there is no such setting in the .srt format (this is confirmed by this page), that will depend on the program you use to view your videos. For example, in the settings of vlc you have "Force subtitle position":

enter image description here

1

There is an extended SRT format specification. The link to visualsubsync merely confirms that this very program only supports the standard spec. It also implies that there indeed is support for coordinations and there is:

You need to place coordinates for the pixels behind the time code like that:

00:10:30,796 --> 00:10:33,799 X1:117 X2:619 Y1:042 Y2:428
<font color="#ffffff">Any kind of text</font>

The example was taken from the following link:

http://forum.doom9.org/archive/index.php/t-86664.html

Your player, encoder, filter etc. might not support the extended SRT specs, though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .