How to time subtitles like an anime fansubber using aegisub

SamKook

Grand Wizard
Staff member
Super Moderator
Uploader
May 10, 2009
3,755
5,154
I found the old timing tutorial I made back in my fansubbing days so if anyone is interested, here it is.
Some stuff might be out of date(like the conversion stuff) since it's quite old but I don't think aegisub changed much since(last update was over 8 years ago) and the general principle still applies.


========================================
A few words you'll need to know:
========================================
"workraw" or "wr" = An encode(video file) of the episode made specifically to work with.
"lead-in" = The time between where you set the start of a line and when they actually start talking.
"lead-out" = The time between after they stop talking and before you set the end of a line.
"keyframes" = The purple lines in the audio graph often associated with scene changes.


========================================
0) Configuring Aegisub:
========================================
Click on View, Options and select the Audio tab.
Check "Snap to adjacent lines" so prevent leaving small empty gaps between the subs and "Snap to keyframes" to help with stopping the subs at scene changes.
Those 2 options won't work properly 100% of the time. When they don't "snap" into place, click again until they do(it usually work the second time).
If it still doesn't "snap" right, move the cursor slightly and it should fix the problem.
You can also set "Default lead-in/out lenght" to 0 since we won't be using them and it will prevent the timing from being altered if you hit one of the keyboard shortcuts by mistake.
Another good option to change is "Show inactive lines". Set it to "Show all" to see all the lines in the audio graph, even those that aren't currently selected.
audio_options.jpg


========================================
1)Loading the audio and video information in Aegisub:
========================================
==============
THE EASY WAY:
==============
Click on Video, Open Video, select the workraw for the episode you're timing and open it.
Click on Audio, Open Audio from Video.


==========================================
THE SLIGHTLY LESS EASY WAY (to load the audio):
==========================================
Click on Audio, Open Audio File..., change "Files of type" to Video Formats or All files, select the workraw for the episode you're timing and open it.


==============
THE HARD WAY:
==============
(Useful for preventing having to reload the audio and video to memory if you close Aegisub)
a) You need to convert the audio from the workraw to .wav format(this is what Aegisub does everytime you load audio in it). After you do this, Aegisub will load the audio instantly.

Convert from MP3 (usually used in .avi):
Open the video in VirtualDub (if a warning about VBR appears, ignore it and click ok), click on the Audio menu, select Full Processing Mode,
click on the File menu, select Save WAV and save it using a different name than the workraw (to prevent it being loaded automatically if you launch the workraw).

Convert from AAC (usually used .mkv or .mp4):
You need to use the command line software faad for this.
Open a command line window (XP and sooner: Start, run, write cmd and press enter Vista/7: Start(windows logo), click the find box, write cmd and press enter)
Go to the folder where faad.exe is using "letter_of_drive:" to change drive and "cd name_of_folder" to change folder(you can use the tab key to complete the names and if the is a space in the folder name, you need to enclose it in quotations marks ).

FOR MP4:
Just write "faad path_to_workraw\workraw_name.mp4"(if there is a space in any of the folders or in the filename, you need to put everything after faad in "") and it will create the wav.

FOR MKV:
You need to extract the aac track from it using mkvmerge and mkvextractgui.
Run MKVextractGUI, in "Input", open the mkv video. Only check the audio track(A_AAC), click extract and wait for a message that tells you it's been done sucessfully.
In the cmd window, write "faad path_to_aac_file\aac_file_name.aac"(if there is a space in any of the folders or in the filename, you need to put everything after faad in "") and it will create the wav.

Rename the .wav to prevent it from beeing loaded when you launch the workraw.

b) You need to extract the timecodes and keyframes from the video.
You can't use Aegisub 2.1.8 for this since there is a bug in it(it will only extract 3 or 4 for each), so you will need to get v2.1.7 portable(so that it won't interfere with the config of 2.1.8).
Open Aegisub 2.1.7 portable and open the video.
In the Video menu, click "Save timecode file..." and save it with a descriptive name(for exemple, add "_time" after the filename).
Next, in the Video menu, click "Save keyframes..." and save it with a descriptive name(for exemple, add "_key" after the filename).
Close Aegisub 2.1.7.

c) You need to load the files in Aegisub.
Click on Audio, Open Audio File... and select the .wav.
Click on Video, Open timecode file... and select the timecode file.
Click on Video, Open keyframes... and select the keyframe file.


========================================
2) Importing the script in Aegisub:
========================================
Open Aegisub, click on the File menu and select Open subtitles...
If the script is a .txt, a popup box will appear.
Change the actor separator to ";" instead of ":" since ":" is sometime used for something else in the script and we don't usually put the actors name in the script.


========================================
3) The rules of timing:
========================================
Rule #1(Lead-in): Add almost no lead-in (max 0.1 sec), but don't add none since it's easy to start the subs a little late>.
Leave just enough space in the audio graph after the start of the line to see the graph flat(assuming there is no other sound).
lead-in.jpg

Rule #2(Minimum duration): Try to leave the subs on for at least 0.7 secs, 1 sec if possible.
If you're under 0.7 sec and can't add more lead-out, you can add more lead-in than usual (around 0.2 or 0.25 max).
If it's still under 0.7 sec, but there is enough time to read it, you can leave it like that.

Rule #3(Lead-out/Total duration): Always add enough lead-out to give time for the watcher to read the subs.
You can check this by playing the lines and reading it(slower than usual if you're a fast reader). If you have time to read it before it stops playing, it means you've added enough lead-out.
If you have time to read it before the japanese stops, you should still add a little lead-out(around 0.3 sec) unless something (such as the start of another line) is preventing you from doing so.

Rule #4(Scene changes): You need to end the subs at scene changes (usually marked by a keyframe) whenever possible.
The only time you don't do this is if there is really not enough time to read the subs if you do so. In that case, end the line at least 0.5 sec after the scene change if possible.
If you would end a line less than 0.5 secs before a scene change, extend the end time to it.
In this group, we don't snap the start of a line to a scene change unless the line is less than 0.1(maybe 0.15) sec after it.

Rule #5(Gaps): Unless there is a scene change between two lines, there should never be a gap of less than 0.5 second between the end of one line and the start of the next.
If a 0.5 or less second gap happens, extend the end of the first line to the start of the next and "snap" it into place.
We do this to avoid the flashing effect it creates.
gap_no_keyframe.jpg

Rule #6(Splitting lines):
a: If the subs exceed 2 lines on screen, split them at a natural break (".", "..." or ",") if there is one. If not, split them where you think it's appropriate.
b: Always split if two people speak in the same line.
c: Split at the appropriate punctuation if there's too long a silence in the same line. For example: "But... (long silence) I want it."
d: Split if a scene change comes during a pause in the line. For example: "But... (pause and scene change) I don't want to!" should be split at the scene change.
e: If 2 persons say the same thing at the same time, duplicate the line so that it shows up twice at the same time on screen.


In short:
Only add a very short lead-in (less than 0.1 sec).
Leave the subs on for at least 0.7 sec when possible.
Leave enough time after to be able to easily read the subs.
Always end the subs at a scene change unless there's not enough time to read it.
Don't leave small empty gaps between the subs (0.5 sec).
Split the subs when appropriate.


========================================
4) Timing the script:
========================================
You'll need to find the way that you feel most comfortable with since it varies between timers, but here's one way to do it.

Enable "Auto goes to next line on commit" and "Auto scrolls audio display to selected line" and disable the 3 other options.
Keep one hand on the mouse and keep the other on the "G" and "space"(or "S") key on the keyboard.
Set the start and end time for the current line with the mouse, press "space"(or "S") to check if it's timed right(adjust timing and repeat until you're satisfied) and press "G" to save the line.

It will bring you automatically to the next line. All you have to do is repeat until the end of the script.
You can also use "Q"(Play audio 0.5 secs before the selection), "W"(Play audio 0.5 secs after the selection), "E"(Play first 0.5 secs of the audio selection) and "D"(Play last 0.5 secs of the audio selection) to make sure the timing is right.
Another useful key is "T". It will play the audio without stopping at the end of the selection.

Once you're done, it's always a good idea to watch the video with the subs to see if you made any mistakes and if the scene changes match correctly with the keyframes (this is sometime an issue with h264 video).


========================================
5) Letting the group know what you're doing:
========================================
It's always useful for the group to know when you are working on a script and when you have finished.
So when you start timing, change the topic in the IRC staff channel to say: "Name_of_what_you're_working_on in timing - Your_name".
When you're done upload the script to the VCS and change the topic to "Name_of_what_you're_working_on timed, needs editing".

Before changing a topic, make sure your IRC client can handle colors in topics.
If it can't, simply say when you begin and finish in the channel or ask someone to change the topic for you.
 

SamKook

Grand Wizard
Staff member
Super Moderator
Uploader
May 10, 2009
3,755
5,154
Could be subtitle edit can do the same stuff, I've never used it since I don't think it existed back in the day or if it did, it wasn't as good as aegisub but since it's still being actively developed and not aegisub, maybe it's good too and the above can be applied to it.

That tutorial was created in mid 2013 so it's quite old but the timing "rules" as I called them won't change.

I know one forum member switched from subtitle edit to aegisub recently though so maybe it's still better.
 
  • Like
Reactions: mei2

Taako

Akiba Citizen
May 25, 2017
1,335
940
This tutorial will be useful for me/ I like the segment on lead in and lead outs.
I usually play it by ear. But I rather have it be standard for my subs and not have to worry:cool:
 
  • Like
Reactions: SamKook

SamKook

Grand Wizard
Staff member
Super Moderator
Uploader
May 10, 2009
3,755
5,154
Glad to hear someone will have some use for it.

I did mess around with subtitle edit a bit and as far as I can tell, it can't load and display keyframes and some keyboard shortcut options are missing but most do work so it just waste a little more time if you like to double check your work.
Keyframes being displayed is super useful to align subtitles to video transitions, but h264 keyframes didn't(likely hasn't changed) align very well to those transitions(scene changes) and we had to make an xvid encode to create accurate ones so probably too much trouble for most people so most likely not a deal breaker for most.
 
  • Like
Reactions: Taako

Taako

Akiba Citizen
May 25, 2017
1,335
940
Glad to hear someone will have some use for it.

I did mess around with subtitle edit a bit and as far as I can tell, it can't load and display keyframes and some keyboard shortcut options are missing but most do work so it just waste a little more time if you like to double check your work.
Keyframes being displayed is super useful to align subtitles to video transitions, but h264 keyframes didn't(likely hasn't changed) align very well to those transitions(scene changes) and we had to make an xvid encode to create accurate ones so probably too much trouble for most people so most likely not a deal breaker for most.
Before I did get a little upset, when my subs don't align accurately. I have gotten better with it and not so upset anymore, but...:p
 
  • Like
Reactions: SamKook