Command Line Parameters

<< Click to Display Table of Contents >>

Navigation:  Batch conversions and automation > Command Line Conversion Tool >

Command Line Parameters

Command line conversion can be executed directly from the command prompt or batch script for that matter by using the below command:

ezc6c [options] <input file> <output file> 

All of the available options required for the successful execution of the above command are explained below.

<input file>

Wildcard characters can be used to specify more files.

<output file>

The exact file name or use @ to specify the input file name. @ is replaced with the input file name without extension.

[options]

–c<config file>

Specifies the configuration file. If no folder is specified, current working folder is assumed. This parameter is mandatory.
Note: Configuration files can be created by modifying the sample_config.cfg supplied during the installation or by using the Config editor too.

–i<format>

Input file's format. This parameter is mandatory.

–o<format>

Output file format. This parameter is mandatory.

-it<template>

Specifies template which can be used with the Custom Text Import option. This parameter is optional and is required only if the input can be imported via the Custom Text Import feature.

-t<template>

Specifies  the template which will be used for the Custom Text Export option. This parameter is optional and is required only if custom text is exported.

-r

Specifies the timecode standard and the frame rate of the input file, -r parameter is optional. If present, this option indicates that a frame conversion of the input file shall be executed and it will output in the frame rate specified with the sample_config.cfg file in the [Video/TC] section. Furthermore, the conversion method can be specified at the [TC Conversion] section.

As part of our Metadata pass-through concept, you can use the Frame Rate indicated in the source file when you set VideoFrameRate=15 in the .cfg file. Please make sure to also select Timecode Format in case the source doesn't contain information about it.

The –r switch shall be followed by a time code standard parameter, which must be one of 24, 25, 30 or 30d (30 fps Drop-Frame) and eventually the actual frame rate 23.976, 25, 29.97, etc. For example –r 24/23.976 specifies 24 fps timecode on 23.976 fps video.

The frame rate attribute is optional and if you miss to specify it, EZConvert will take the default frame rate for the selected time code standard. If the time code format is 24, EZConvert will decide the frame rate is 24 fps for instance.

In addition, you can use <from_source> option to indicate that that the frame rate and timecode format of the source will be used, if available. The valid combinations in this case are:

-r from_source - both frame rate and timecode format will be read from the source. If one of them isn't present, respective error will be output in the console and the error stream.
-r df/from_source or -r ndf/from_source - if source frame rate is 30 or 60 fps and the timecode format can't be determined from the source file it is assigned to 30 drop-frame/non-drop or 60 drop-frame/non-drop respectively. Otherwise the timecode format will match the source frame rate.

-print

Changes the format of the console and STDOUT outputs to XML: -print XML and JSON: -print JSON. If not used, console and STDOUT outputs will be displayed as plain text. You may refer to the Usage and Examples topic for more details.

The -print parameter is optional.

-recognize

Optional parameter which automatically identifies the format of the subtitle file you can use the -recognize switch followed by the file's name:

 ezc5c -recognize C:\Test\Sample.xml

The program will output on StdOut the switch that should be used with -i option:

 EZConvert 6.0.1  Command Line Version
 DLP_XML

-fileDetails

Optional parameter. Shows additional information about the input file such as Title, Lang, FrameRate, MediaStartTC, FirstInCue, LastOutCue, Subtitles Count. Depending on the source file type additional metadata may be available too.

-dumpSubtitles

Optional parameter - can be used only with -fileDetails and will output/dump the text of specified number of subtitles in the command line. For example, -dumpSubtitles 5 will output the text of the first 5 subtitles from the output file, -dumpSubtitles 50 - the first 50 subtitles and so on.

-f

Instructs the program to invoke the Fix Subtitles commands on all the subtitles according to the rules set in the [Fix Subtitles] section in the config file. Fix Subtitles commands executed from the command line converted will be performed for both the main and secondary subtitle tracks simultaneously.

The -f parameter is optional.

-check

Instructs the program to run Checks on all subtitles in the file according to the respective check rules set in the [Checks] section in the config file.Check Subtitles commands executed from the command line converted will be performed for both the main and secondary subtitle tracks simultaneously.

The -check parameter is optional.

-detailedCheck

-detailedCheck can be used to display detailed information about every error found while running Checks.

It needs to be used along with -check, otherwise it wouldn't work.

–l<log file name>

Output log is redirected to the specified file.

This is optional parameter. If -print has been used, the output log will be formatted as either XML or JSON too.

More details regarding error handling are available with the Usage and Examples topic.

Override configuration file  from the Command Line

EZConvert provides additional functionality to override or alternate any of the parameters in the config.cfg file directly from the command line. The exact syntax is as follows:

ezc6c [options] <input file> <output file> "[Section Name in config.cfg]Parameter=New Value"

where
[Section Name in config.cfg] - points to the exact section the parameter is part of;

Parameter - the exact parameter which we need to alter;

New Value - the new value for that parameter.

Note: It isn't necessary to enclose it in quotation marks but we recommend doing so at all times because a lot of the Sections and Parameters contain space.

 
So, if we wanted to change text's alignment in the output file directly from the command line we could execute the conversion like this:

ezc6c [options] <input file> <output file> "[Text Attributes]GlobalAlignment=1"

The above line will override the respective GlobalAlignment attribute from the config.cfg file and as a result all subtitles will be exported with new horizontal alignment in the output file. In this case, they'll be aligned to the right.

We can alter any of the output file's specific options with the same success. For example:

ezc6c [options] <input file> -o NFLX_TT "[Netflix Timed Text]Language ID=en"

Running the above command will change the Language ID in the output Netflix-TT file to English: xml:lang="en".

Text Replace

Text Replace is intended as an advanced option aimed at resolving various issues with corrupt or unsupported by the selected output file characters. The characters or words specified will be replaced automatically during the conversion.

We recommend modifying the configuration .cfg file through the Config Editor tool directly, but if this isn't applicable for some reason you can always do that by hand.

To do so, add new section in the .cfg file named [TextReplace]. The replacement list itself must follow the following pattern:

[TextReplace]

Replaces=[{"Text":"…","Replace:"..."}, {"Text":"&#x201c;","Replace":"&#34;"},{"Text":"&#x201d;","Replace":"&#34;"}]

There are three different replacements shown with the example above that will:

1. replace the ellipsis symbol "…" with three regular full stops "...";

2. replace the opening smart quote '“' with regular quotation mark '"';

3. replace the opening smart quote '”' with regular quotation mark '"';

Note: If the search term contains ampersand "&" it has to be written by its reference code: &amp;. This is a character and has to be escaped by its reference code. Thus replacing  "&amp;" with "&amp;amp;" will replace the ampersand symbol with its reference code. For example "AT&T" in the source file will become "AT&amp;T" in the output.

You may refer to this page for a list of the most commonly used characters and their respective reference codes.

Merging files from the Command Line

EZConvert allows subtitle files to be merged directly from the Command Line by using the following command:

ezc6c -c config.cfg -i STL - o STL "InputFile_1.stl|InputFile_2.stl" Merged.stl

The input files must be separated by vertical line "|" and the whole expression must be enclosed in double quotation marks: "InputFile_1.stl|InputFile_2.stl".

It isn't also necessary to merge files in the same format, two input files can be in different format. In order to make this work, however, you may want to use the "-i Auto" switch:

ezc6c -c config.cfg -i AUTO - o NFLX_TT "InputFile_1.srt|InputFile_2.xml" Merged.dfxp

It is, however, required to properly configure the section in the config.cfg file for each one of the input file types, as well as for the output file.