AVI-Mux GUI

script files in AVI-Mux GUI

Alexander No, Oct 13, 2007





back to main page

General

AVI-Mux GUI supports script files to automatize processes or easily load common configurations.
The available instructions are explained using Backus Naur Format.

All of the following settings refer to a setting available in the configuration windows and will internally not be treated differently from these. The scripting is merely another way of setting them.

Character coding

You can use script files using the current windows character coding as well as script files using UTF-8 coding and start with the corresponding BOM.


Syntax checking for script files

Error checking has been added for script files with version 1.15.
However, there is no kind of guaranty that it works.
Make sure that your files are error free, otherwise AVI-Mux GUI might behave unpredictably, especially if it does not catch an error.

Usage

Script files are opened the same way as any other type of supported media files, including the possibility of drag-and-drop.

You can write such script files simply in the Windows Editor, or using another piece of software, for example for passing files over to AVI-Mux GUI.


Available commands


ADD VIDEOSOURCE Concatenates all selected video source files to one video source 1.12
CLEAR Removes all loaded files from the list boxes 1.12
DESELECT [ FILE | AUDIO ] n Mark the n-th source file / audio stream as not selected. Use n = 0 to refer to all 1.13
LANGUAGE s Set the language of the GUI to s. A corresponding language file is of course required. s has to be the name of the language, indicated in the NAME section of the corresponding language file. 1.15
LOAD filename Loads the specified file. The file name must be absolute till 1.15.2, and can be relative from 1.15.3 on.
Thisname must be absolute till 1.15.2, and can be relative from 1.15.3 on.
This can also be another script file.

This command can cause an infinite recursive call, crashing the program, when used improperly or with foul intention (file a loads file b, file b loads file a)!
1.12 / 1.15.3
SELECT [ FILE | AUDIO ] n Mark the n-th source file / audio stream as selected. Use n = 0 to refer to all 1.12
START name Starts a muxing process using the output file name name 1.14.1
WITH expr
...
...
END WITH
Within that block, expr is added to the beginning of each line. You can nest these blocks. 1.15

SET INPUT OPTIONS Following SET OPTION instructions refer to input options. 1.12
SET OPTION USE CACHE n When n = 1, a cache will be used to improve reading performance of source files.
This option is applied to any files loaded afterwards.
1.13
SET OPTION AVI FORCE MP3VBR n MP3 streams in AVI files will always be considered VBR when adding a video source when n = 1 1.12
SET OPTION AVI FIXDX50 n biCompression - values of DX50 will be fixed to divx if n = 1 1.12
SET OPTION AVI IGNLCHUNKS [ ON | OFF | n ] Select whether or not large chunks shall be ignored (using ON / OFF), or select the size beginning from which a chunk is considered large, measured in kBytes 1.15
SET OPTION AVI TRY2FIXLCHUNKS n  Select whether or not large chunks shall be fixed if only the index is broken, but not the chunk header itself. 1.15
SET OPTION CHAPTERS IMPORT n Select whether or not chapters from source files shall be imported 1.15
SET OPTION CHAPTERS FROMFILENAM SET OPTION CHAPTERS FROMFILENAMES n Select whether or not chapters shall be created from source file names. If chapters are imported as well, they will be added as subchapters.

This option is only applied if a video source is added which consists of more than one Matroska source file.
1.15
SET OPTION M2F2 CRC n n = 1 activates CRC-check for Mode 2 Form 2 - Sources loaded afterwards 1.12
SET OPTION MP3 VERIFY CBR [ NEVER | ASK | ALWAYS ] Select the behaviour of AVI-Mux GUI when loading MP3 files of which the beginning looks like CBR 1.12
SET OPTION MP3 VERIFY RESDLG [ 1 | 0 ] Selects whether the result of checking an MP3 file which looks like CBR is to be displayed in a window 1.12

SET OUTPUT OPTIONS Following SET OPTION instructions refer to output options. 1.12
SET OPTION ALL AUDIO n  Use n = 1 to use all audio streams, regardless of the selection 1.12
SET OPTION ALL SUBTITLES n  Use n = 1 to use all subtitle streams, regardless of the selection 1.13
SET OPTION AUDIO INTERLEAVE n [ KB | FR ] Set the audio interleave to n kBytes or frames 1.12
SET OPTION [ AUDIO | VIDEO | SUBTITLE ] NAME s n Set the name of the s-th audio stream to n. 1.14
SET OPTION [ AUDIO | VIDEO | SUBTITLE ] LNGCODE s n Set the language code of the s-th audio stream to n. 1.14
SET OPTION [ AUDIO | VIDEO | SUBTITLE ] NAMEEX n lngcode title This option refers to the n-th stream of the indicated type (audio, video, subtitle). When lngcode equals "*", all applied stream titles are erased. Otherwise, the title equals "*", all applied stream titles are erased. Otherwise, the title in language lngcode is set to title. Note that the NAME option is equal to use this option with lngcode=und. The title with language code 'und' is also the one that is used for AVI output. 1.17.8
SET OPTION AUDIO SBR n f Select whether or not the n-th audio stream is SBR (f = 1 -> SBR). This setting only affects AAC streams inside AAC- and AVI files, but not inside MKV files. 1.15.4
SET OPTION AVI 

AC3FPC n Defines how many AC3 frames can be put into one AVI chunk 1.16.11
DTSFPC n Defines how many DTS frames can be put into one AVI chunk 1.16.11
MP3FPC n Defines how many MP3 frames can be put into one AVI chunk 1.16.11
RIFFAVISIZE n Defines the size in MB of the first RIFF list for Open-DML AVI files. This value cannot exceed 2047 and should not exceed 2040. 1.16.11
ADDJUNKBEFOREHEADERS n When this setting is enabled, output AVI files will have 8 bytes of junk before the first header, which will be created exactly the way the AVI file format specification allows it. Even though this is totally spec compliant, it breaks some AVI parsers. Enable this setting to break some AVI parsers. 1.17
HAALIMODE n Enables or disables the low overhead mode.

"Haali" is the nickname of the "inventor" of the idea to interpret the Open-DML file format specification this way, thus 'HAALIMODE'.
1.16.11
1.15
SET OPTION CHAPTERS

CLEAR Removes all chapters from the chapter tree
ADD&nbse
ADD n1 n2 s Adds a chapter from n1 till n2 named s.
Format for n1 and n2: h:min[:sec[.frac]]
APPEND n s Adds a chapter beginning at n, and ending at the beginning of the next chapter (Format as in CHAPTERS ADD)
APPENDREL n s Adds a chapter beginning at n after the begin of the preceding chapter, and ending at the beginning of the next chapter (Format as in CHAPTERS ADD)
SUB BEGIN Chapters which are added after that instruction will be a subchapter of the latest chapter that has been added. You can nest subchapters
SUB END End of list of subchapters
1.15
SET OPTION CLOSEAPP n If set to 1, the application will be closed as soon as the muxing process is finished. 1.15
SET OPTION DELAY s n Set the delay of the s-th audio stream to n milliseconds 1.12
SET OPTION DEFAULT [ AUDIO | VIDEO | SUBTITLE ] n [ 0 | 1] Use (or not) the n-th stream of the indicated type as default stream. 1.13
SET OPTION DONEDLG n Set n = 0 if you do not want a message to be displayed when the operation is finished.
This option is automatically reset to 1 after each muxing process!
1.14.1
SET OPTION FRAMES n Use only n frames of the video source. n = 0 => use all frames 1.12
SET OPTION LEGACY n n = 1 activates writing a legacy index to Open-DML files, n = 0 deactivates it 1.12
SET OPTION MAXFILES [ ON | OFF | n ] Set the maximum number of output files to n, or activate / deactivate the usage of this setting. 1.12
1.12
SET OPTION MAXFILESIZE [ ON | OFF | n ] Set the maximum filesize to n MBytes, or activate / deactivate splitting of files based on file size 1.12
SET OPTION MKV 

CUES n Enable or disable creation of Cues. If n is 0, this setting overrules all other CUES commands. 1.16
CUES VIDEO n
CUES AUDIO n
CUES AUDIO ONLY_AUDIO_ONLY n
CUES SUBS n
Enable or disable creation of Cues for certain stream types, assuming that Cues are generally enabled. 1.17
CUES AUTOSIZE n Enables or disables estimation of space required for Cues 1.17.2
CUES TARGETSIZERATIO n This value, devided by 1000, indicates the target size of Cues: When a matroska file is closed after muxing, and if AUTOSIZE is enabled, some CuePoints are deleted, so that the remaining CuePoints use n/10 per cent of the available free space. Since this process is randomized, the value should not be too close to 1000. The highest value that is accepted is 999 1.17.2
CUES MINIMUMINTERVAL n Defines the minimum interval between 2 CuePoints for the same stream. If this value is too small, a lot of CuePoints will be created for audio streams, resulting in excessive memory usage. When AUTOSIZE is enabled, only a subset of the CuePoints created will be written to the output file. 1.17.2
CUES SIZERATIO n Defines, in kilobytes, how much space is reserved for Cues per stream (subtitles don't count) if AUTOSIZE is enabled. 1.17.2
LACE n Selects a lacing scheme for Matroska output:
  • 0 = off
  • 1 = xiph lacing
  • 2 = EBML/fixed lacing
  • 3 = automatic = EBML/fixed lacing
  • 3 = automatic
1.15.6
LACESIZE (n) | ((mp3 | aac | ac3 | dts | vorbis | general) use dur) Selects the number of milliseconds dur of audio one block of a Matroska file will contain.

If the use value is 0, this setting will be applied, but the general setting will be used instead.
Only indicating n is obsolete. Setting use to 0 for general is invalid.

Example: LACESIZE aac 1 200
CLUSTERSIZE n Set the maximum cluster size to n kByte
CLUSTERINDEX n Select if an entry shall in the seekhead should be created for each cluster 1.16
CLUSTERTIME n Set the maximum cluster time span to n*timecode scale nanoseconds. n must be between 0 and 60000, and shall be between 0 and 32767. Other values may cause undefined behaviour.
PREVCLUSTERSIZE n Select whether or not the PrevClusterSize element shall be written into each cluster
NONCLUSTERINDEXMODE n When this setting is 1, all non-clusters are indexed in the first seekhead. When it is 0, some non-clusters might be indexed in the second seekhead, if there is one. 1.17
CLUSTERPOSITION n Select whether or not the Position element shall be written into each cluster
DISPWH n When this setting is enabled, the DisplayWidth and DisplayHeight elements are always written to matroska files, even when they don't differ from PixelWidth and PixelHeight.
2ND_COPY_OF_TRACKS n When this setting is enabled, a second copy of the Tracks element will be written to the end of the file. The first copy is always stored before the first cluster
RANDOMIZE_ORDER n When this setting is enabled, certain child elements within certain parent elements will be written to the target file in random order. This allows to check if other matroska parsers make invalid assumptions concerna parsers make invalid assumptions concerning the order of certain elements.
FLOAT_WIDTH n Select the width, in bits, of floats written to matroska files. When Matroska 1.0 compatibility is enabled, 32 and 64 are valid. When Matroska 1.0 compatibility is disabled, 32, 64 and 80 are valid.
HEADERSIZE n Set the size in kB reserved for headers before the first cluster. If automatic Cue size setting is enabled, this value must be 0. 1.17.2
LIMIT1STCLUSTER n Select whether or not the first cluster of the output file shall be limited to a maximum of 30 seconds, even if the ClusterTime setting is higher.
TIMECODESCALE [ mkv | mka] n Allows to set the timecode scale to be used with matroska video (mkv) and audio (mka) files. 1.16
1.15
SET OPTION MP3 CBR FRAMEMODE n Activates or deactivates frame mode for MP3 CBR streams. 1.14
SET OPTION NO AUDIO n  Use n = 1 to create output files without any audio stream 1.12
SET OPTION NO SUBTITLES n  Use n = 1 to create output files without any subtitle stream 1.13
SET OPTION NUMBERING [ ON | OFF | s ] Activate or deactivate numbering or sets the format string to s 1.12
SET OPTION OGG PAGESIZE n When extracting Vorbis streams from OGG, MKV or AVI files, the target OGG file will use pages of not more than n bytes. The largest value making sense is 65025 (an OGG page can contain 255 "segments" of 255 bytes each at most) 1.16.11
SET OPTION OPENDML n n = 1 activates Open-DML - output, n = 0 deactivates Open-DML 1.12
SET OPTION OVERWRITEDLG n If you set n = 0, there will be no warning if files are to be overwritten during the next muxing process.
Tng if files are to be overwritten during the next muxing process.
This option is automatically reset to 1 after each process!
1.14.1
SET OPTION PRELOAD n Sets the preload value to n milliseconds 1.12
SET OPTION PRLAC  [ BYTE | SCALED ] Select whether you want the amount of written data to be shown in Bytes, or on a scaled base. 1.15
SET OPTION RECLISTS n n = 1 activates rec list creation, n = 0 deactivates it 1.12
SET OPTION RESOLUTION width[ x | X | : ]height Define output resolution for anamorphically encoded video. This option is only taken into account for MKV output 1.15
SET OPTION SPLIT POINTS [ ON | OFF | ADD s ] Sets positions where to begin a new file, or activates / deactives the usage of this list.
Warning! Syntax for v1.14 is different and not compatible!!

Use the same syntax as in the split point menu for s.
1.15
SET OPTION STDIDX [ RIFF | AUTO | n FRAMES ] Select the pattern for standard index creation: One per stream and RIFF list, or one per stream and n frames, or automatic setting 1.13
SET OPTION STDOUTPUTFMT [ AVI | MKV ] Choose either AVI or MKV as standard output format 1.15
SET OPTION SUBTITLE NAME s name Set the name of the s-th subtitle to name 1.13
SET OPTION TITLE s Set s as Segment title (MKV only) or File title (AVI only and ANSI only!) 1.15


I'll illustrate this with some examples (using 1.15 syntax!):

Example 1:
Load a video and 2 audio files, set a delay for one of them, and save as Open-DML AVI:

CLEAR
LOAD h:\movies\akte-x-mv.avi
LOAD h:\movies\akte-x-eng.ac3
LOAD h:\movies\akte-x-fr.ac3
SELECT FILE 1
ADD VIDEOSOURCE
SET OUTPUT OPTIONS
WITH SET OPTION
WITH AUDIO
NAME 1 english
NAME 2 french
DELAY 2 -88
END WITH
OVERWRITEDLG 0
CLOSEAPP 1
ALL AUDIO 1
OPENDML 1
LEGACY 0
REC LISTS 1
AUDIO INTERLEAVE 250 KB
NUMBERING OFF
MAXFILESIZE OFF
MAXFILES OFF
END WITH
START h:\movie\akte-x.avi