SubtitleConverter on the command line

SubtitleConverter - Convert subtitle files »

Download SubtitleConverter Free Trial »     Buy SubtitleConverter Now »

There are two separate ways to run SubtitleConverter from a script. Either you give it a task file that describes the whole job, or you name the source and the destination on the command line with the convert verb and let it work the rest out. Everything below is sorted by that one difference, so you can skip straight to the half you need.

 With a task fileWith no task file
What you type SubtitleConverter task="job.stct" SubtitleConverter convert --from=... --to=...
Where the job is described In the .stct file - built by the wizard, or written by hand Nowhere: the arguments are the whole job
Best for Repeated jobs, exact field mapping, a scheduled task A one-off run inside a script, a batch file or a CI step
Reusable Yes - save once, run as often as you like No - the paths are retyped every time

1. With a task file

A task is a small text file (.stct) that holds one job: the source, the destination, the field map and the options. The program can write it for you, and the generated .bat / .sh file already contains the command line you need.

1.1 Create the task

In the GUI you save a convert task, then click "Save & Make Batch File". You get a .bat file for Windows or a .sh file for Linux / macOS, and you run it from the command line.

Convert subtitle files - batch convert

1.2 Run it

Windows:

C:
cd "C:\Users\pan\AppData\Local\Programs\SubtitleConverter\"
SubtitleConverter task="C:\Users\pan\Documents\job.stct" logfile="C:\Users\pan\Documents\job.log"
	

Linux:

/usr/share/SubtitleConverter/SubtitleConverterCmd task="/home/pan/Documents/job.stct" logfile="/home/pan/Documents/job.log"
	

macOS:

/Applications/SubtitleConverter.app/Contents/MacOS/SubtitleConverter task="/Users/pan/Documents/job.stct" logfile="/Users/pan/Documents/job.log"
	

1.3 Shorter forms

SubtitleConverter task="a.stct" [logfile="run.log"]
SubtitleConverter a.stct                       (same as task="a.stct")
	

The path alone is accepted. There is no session= spelling here - the keyword is task=, and a bare path means the same thing.

1.4 What is inside a task file

A .stct file is plain text - an INI file with one [SubtitleConvert] section. A real one looks like this:

[SubtitleConvert]
SourceFile=${session_dir}\video\movie.srt
SourceFormat=SRT
DestFile=${session_dir}\video\movie.vtt
DestFormat=VTT
WithTimestamps=1
	

The two format keys take the names listed below, not the extensions. WithTimestamps only matters for the text destinations (CSV, TXT): set it to 0 to write the lines without their time codes.

Rather than memorize the keys, ask the program (see section 7):

SubtitleConverter schema             every known key, with its type and meaning
SubtitleConverter init               a commented task template to start from
SubtitleConverter describe task="job.stct"     what an existing task will do
	

2. Without a task file: convert

The convert verb takes the two files, so no task file is needed. Each side is read from the file extension unless --from-format= / --to-format= says otherwise; a destination with an unknown extension keeps the source format.

SRT to WebVTT (the format is inferred from the extension):

SubtitleConverter convert --from="C:\video\movie.srt" --to="C:\video\movie.vtt"
	

And back, with an explicit source format:

SubtitleConverter convert --from="C:\video\movie.vtt" --to="C:\video\movie.srt" --from-format=VTT --to-format=SRT
	
ExtensionFormat name
.srt SRT
.vtt VTT
.sbv YouTube
.ass / .ssa ASS / SSA
.ttml TTML
.dfxp / .xml DFXP
.smi SMI
.sub SubViewer, or MicroDVD when the first line is not [SUBTITLE]
.lrc / .csv / .txt LRC / CSV / TXT
OptionMeans
--from / --to The two files.
--from-format= / --to-format= Name the formats instead of letting the extensions decide.
--timestamps=0 Leave the time codes out of CSV / TXT output.

3. Options that work with both

These are accepted whether the run is task=... or convert ...:

OptionMeans
--set=Section.Name=Value Override one value in the task without editing it. Repeatable.
--var=NAME=VALUE, --var-file=FILE Define the variables used in session values - see section 4.
logfile=FILE Write the run log to FILE.
--help / -h, --version The built-in reference and the version.

There is no --dry-run in this build. To try a job safely, point the destination at an empty folder and delete it afterwards - the run writes only there.

On Windows, add a logfile= to see any of it. The program is a windowed application with no console attached, so what it prints - --help, the plan, schema - never reaches the command prompt and is not captured by > either. Give it logfile=plan.log and open that file.

Change one value without editing the task

SubtitleConverter task="a.stct" --set=SubtitleConvert.DestFormat=VTT
SubtitleConverter task="a.stct" --var=OUT=C:\out --set=SubtitleConvert.DestFile=${var:OUT}\movie.vtt
	

In any task value you can use these variables:

${today}              -> 2026-10-04                     today's date
${yesterday}          -> 2026-10-03                     yesterday
${now}                -> 2026-10-04 09:30:00            today's date and time
${env:NAME}           -> ${env:TEMP}                   -> C:\Users\pan\AppData\Local\Temp
${var:NAME} / ${NAME} -> ${var:OUT} / ${OUT}            with --var=OUT=C:\out this is "C:\out"
${session_dir}        -> C:\tasks                       the folder that contains the task file
${session_name}       -> a.stct                         the task file name
	
[SubtitleConvert]  SourceFile=${session_dir}\in.srt              -> C:\tasks\in.srt
[SubtitleConvert]  DestFile=${session_dir}\out\movie-${today}.vtt -> C:\tasks\out\movie-2026-10-04.vtt
[SubtitleConvert]  DestFile=${env:OUT_DIR}\movie.vtt             -> D:\out\movie.vtt (with:  set OUT_DIR=D:\out)
[SubtitleConvert]  DestFile=${session_dir}\out\${var:JOB}.vtt   -> C:\tasks\out\lesson1.vtt (with:  --var=JOB=lesson1)
	

4. Variables inside a task

Any value in a task can hold a variable. It is expanded just before the run, so one task can serve every machine, every folder and every day. ${session_dir} is the one that makes a task portable: write the paths relative to the file and the whole folder can be copied to another machine and still runs.

VariableBecomes
${today} A date, 2026-11-27
${yesterday} / ${tomorrow} The day before / after
${now} Date and time, 2026-11-27 09:30:00
${env:NAME} An environment variable, e.g. ${env:TEMP}
${secret:NAME} A password kept out of the file: WD_SECRET_NAME, then the environment variable NAME, then secrets.ini
${var:NAME} / ${NAME} A value given with --var=NAME=VALUE or --var-file=FILE
${cwd} The current working directory
${session_dir} / ${session_name} / ${session_ext} The folder, file name and extension of the session itself

5. Running it on a schedule

In the program, "Create & Schedule Task" writes the batch file and registers it with the Windows task scheduler, so the job runs at a fixed time, or every day at that time. See Schedule Task for the dialog.

SubtitleConverter schedule --task="job.stct" --daily=02:30
SubtitleConverter schedule --task="job.stct" --daily=02:30 --install
	

Without --install it only prints the line; with it, the entry is registered (schtasks on Windows, an appended crontab line on Linux / macOS). Whatever you schedule, end the command with a logfile= - a scheduled run has no one watching it, and the log is the only record of what happened.


6. Exit codes

A scheduled or scripted run should be judged by the exit code, not by what is on screen:

CodeMeans
0 Success - the subtitle was converted.
1 Usage or run problem: nothing to do, a bad command line, or the run could not start.
3 The task ran but ended with errors.
4 The task file is missing or invalid.
5 pipeline only: a tool the list needs was not found.

Note that an unrecognised option is ignored rather than rejected, so a typo does not fail the run. Run the job once with a logfile= before you trust a new command line.


7. Let the program describe itself

The same information this page gives you is available from the program, which cannot drift out of date:

SubtitleConverter schema [--json]                       list the task keys
SubtitleConverter init                                  print a commented task template
SubtitleConverter describe --describe=a.stct [--json]   describe an existing task
SubtitleConverter capabilities [--json]                 list the commands
SubtitleConverter schedule --task="a.stct" --daily=02:30 [--install]
SubtitleConverter mcp                                   run an MCP server on stdio (for AI agents)
	

Note: this app uses its own converter, so --dry-run is not available.


8. Several tools in one go

SubtitleConverter can also run a list of tasks in order and write one summary report, so one scheduled command can chain several tools. Put one command per step in a tasks.ini, then run it with:

SubtitleConverter pipeline --file=tasks.ini logfile=pipeline.log

[Pipeline]
Report=C:\logs\report.txt

[Step1]
Name=First step
Args=... the same flags you would type after SubtitleConverter ...
logfile=step1.log

[Step2]
App=AnotherTool
Args=... flags for that tool ...
logfile=step2.log
	

Steps run in order. Run SubtitleConverter pipeline with no file to print a template; if a required tool is missing the run stops with exit code 5 (mark a step Optional=1 to skip it). See the Automation & pipelines guide and SubtitleConverter --help.


Related

Save and load a task · help · batch conversion