-
Notifications
You must be signed in to change notification settings - Fork 60
Command line options
Options available in version 0.16 or newer.
Changes since version 0.15
In 0.16 command line options processing was refactored. While new options are mainly backward-compatible, there are several differences:- in headless mode, configuration options that are not specified directly will not get values saved from the app, default values will be used instead;
-
batch
command was replaced with--import
switch to import task list and--batch
switch to open batch processing window (in GUI mode); - there are numerous other differences that are not affecting backward-compatibility, read further for details.
Terms used in this file:
- sub - subtitle file that is synchronized;
- ref - file used as reference for synchronization, could be video with audio or subtitle stream or standalone audio or subtitle file;
- task - synchronization task is a single synchronization process with defined input (sub and ref) and output;
- stream - single component of multimedia file (audio, video or subtitle), sometimes called track;
- GUI - Graphic User Interface;
- headless - command line interface, mode without GUI.
Usage: subsync [OPTIONS]
For more information run subsync --help
.
SubSync can run in two modes: GUI (default) and headless. To run in headless mode, use --cli
switch or run subsync-cmd
executable (not available in all platforms).
One or more tasks could be specified in two ways: directly from command line, using sync
command, or using yaml file, with --import
switch.
Specify single synchronization task. Several tasks could be specified in single subsync
invocation.
Usage: subsync [OPTIONS] sync [TASK OPTIONS] sync [TASK2 OPTIONS] ...
Where [TASK OPTIONS]
are:
-
--sub PATH
,--sub-file PATH
/--ref PATH
,--ref-file PATH
- path to sub/ref file; -
--sub-stream NO
/--ref-stream NO
- stream number (optional); -
--sub-stream-by-lang LANG
/--ref-stream-by-lang LANG
- select stream by 3-letter language code (optional); -
--ref-stream-by-type TYPE
- select stream by type (sub
oraudio
); -
--sub-lang LANG
/--ref-lang LANG
- language 3-letter code defined by ISO 639-3 (optional); -
--sub-enc ENC
/--ref-enc ENC
- character encoding (optional); -
--sub-fps FPS
/--ref-fps FPS
- framerate (optional); -
--ref-channels CHANNELS
- ref audio channels to listen to (optional). Could be specified as comma separated channel codes,auto
orall
(default). -
--out OUT
,--out-file OUT
- output file path (optional in GUI, required in headless); -
--out-fps FPS
- output framerate (for fps-based subtitles); -
--out-enc ENC
- output character encoding (optional).
Options --ref-stream-by-lang
and --ref-stream-by-type
could be combined together.
In headless mode output must be specified, in GUI it is ignored.
If stream is not specified, first subtitle/audio stream will be selected automatically (subtitles are preferred over audio, also for ref).
Language must be known only for audio ref stream. If not specified explicitly, it will be read from file metadata (if available). It should be also known if sub is of different language than ref, allowing SubSync to use appropriate dictionary. Language information also improves character encoding detection.
List of tasks could be loaded from yaml file using --import [PATH]
switch. This could be manually written description or exported from SubSync batch processing window. Yaml file contains list of objects with sub, ref and out entries corresponding to sync command options.
Example yaml description:
- sub:
path: '/path/to/sub1.srt'
stream: 1
lang: 'eng'
enc: 'UTF-8'
ref:
path: '/path/to/ref1.avi'
stream: 3
fps: 23.976
lang: eng
out:
path: '/path/to/out1.srt'
enc: utf-8
- sub:
path: '/path/to/sub2.srt'
ref:
path: '/path/to/ref2.avi'
out:
path: '/path/to/out2.srt'
-
-h
,--help
- display help text and exit; -
-v
,--version
- display version information and exit.
In this mode, no GUI is shown. It could be used in scripts or in command-line only environment.
-
-c
,--cli
- enable headless mode; -
--verbose LEVEL
- verbosity level (0 - 3), with higher number will print more data; -
--offline
- don't attempt to contact remote server to get missing assets.
Under Windows use subsync-cmd.exe
executable to see the command output.
-
--batch
- open batch processing window.
Allows to fine-tune synchronization process. In headless mode omitted options will have its default values, in GUI mode values set in settings window will be used.
-
--effort EFFORT
- how hard to try (0.0 - 1.0); -
--overwrite
- overwrite existing files; -
-j NO
,--jobs NO
- number of concurrent synchronization threads; -
--window-size WINDOW_SIZE
- maximum correction (in seconds); -
--max-point-dist DIST
- maximum acceptable synchronization error (in seconds); -
--min-points-no NO
- minimum synchronization points no; -
--min-word-prob PROB
- minimum speech recognition score (0.0 - 1.0); -
--min-word-len LEN
- minimum number of letters for word to be used in synchronization; -
--min-correlation CORRELATION
- minimum correlation (0.0 - 1.0); -
--min-words-sim SIM
- minimum words similarity for synchronization point (0.0 - 1.0); -
--out-time-offset OFFSET
- fix output subtitle timestamps by given offset, in seconds.
-
--loglevel LEVEL
- set logging level, one ofDEBUG
,INFO
,WARNING
,ERROR
,CRITICAL
; -
--logfile PATH
- dump logs to file; -
--dump-words SRC[:PATH]
- dump words to file, or to standard output if there is noPATH
,SRC
is one of:sub
,subPipe
,subRaw
,ref
,refPipe
,refRaw
.
To be used with --ref-channels
switch.
NAME | DESCRIPTION |
---|---|
FL | front left |
FR | front right |
FC | front center |
LFE | low frequency |
BL | back left |
BR | back right |
FLC | front left-of-center |
FRC | front right-of-center |
BC | back center |
SL | side left |
SR | side right |
TC | top center |
TFL | top front left |
TFC | top front center |
TFR | top front right |
TBL | top back left |
TBC | top back center |
TBR | top back right |
DL | downmix left |
DR | downmix right |
WL | wide left |
WR | wide right |
SDL | surround direct left |
SDR | surround direct right |
LFE2 | low frequency 2 |
In headless mode SubSync returns 0
if all synchronization tasks succeeded, 2
if synchronization of at least one task failed and other values if error occurred (other than synchronization error).