Avidemux may be called with many arguments. The most obvious is //​avidemux(nbsp)myFile.avi//,​ that will load myFile.avi.

Avidemux may be called with many arguments. The most obvious is //​avidemux(nbsp)myFile.avi//,​ that will load myFile.avi.

-

You can also provide other commands, each one of them beginning by(nbsp)(ndash) ​to invoke an action. You won't have the full capabilities of the GUI though.

+

You can also provide other commands, each one of them beginning by "​--" ​to invoke an action. You won't have the full capabilities of the GUI though.

**Warning**:​ When in command line mode, all alert boxes will be skipped and questions will be automatically set to NO.

**Warning**:​ When in command line mode, all alert boxes will be skipped and questions will be automatically set to NO.

-

-

**Warning**:​ It is very important to note that indexes are not saved. For example, if you do //​avidemux2(nbsp)file.nuv//​ you won't be prompted to save the index.

The arguments are evaluated from left to right and processed one at a time. The command line is far from bullet proof as most of the checks are inside the GUI.

The arguments are evaluated from left to right and processed one at a time. The command line is far from bullet proof as most of the checks are inside the GUI.

-

A workbench ​file is a project ​file. The term workbench refers to the currently active video and settings in the program. When you save a workbench you are really saving ​it to a project file.

+

A project ​file is a file containing all settings ​and loaded files. It is a "​snapshot"​ of avidemux state at the point it was saved.

===== Commands =====

===== Commands =====

Line 82:

Line 80:

|<​nowiki>​--</​nowiki>​auto-split ​ |Size in megabytes ​ |Avidemux will automatically split the files when they reach the given size and create file.avi, file.avi.1, file.avi.2... The default is 2 GB. |

|<​nowiki>​--</​nowiki>​auto-split ​ |Size in megabytes ​ |Avidemux will automatically split the files when they reach the given size and create file.avi, file.avi.1, file.avi.2... The default is 2 GB. |

-

===== Examples =====

-

-

==== Converting AVI files to VCD ====

-

-

Encoding the audio with libavcodec:

-

-

<​code>​

-

avidemux2 --load input.avi --audio-process \

-

--audio-normalize --audio-resample 44100 --audio-codec MP2 \

-

--audio-bitrate 224 --output-format PS --video-process \

-

--vcd-res --video-codec VCD --save output.mpg --quit

-

</​code>​

-

-

Encoding the audio with TWOLAME:

-

-

<​code>​

-

avidemux2 --load input.avi --audio-process \

-

--audio-normalize --audio-resample 44100 \

-

--audio-codec TWOLAME --audio-bitrate 224 \

-

--output-format PS --video-process --vcd-res \

-

--video-codec VCD --save output.mpg --quit

-

</​code>​

-

-

==== Re-encoding a soundtrack to MP3 VBR ====

-

-

First save the audio in WAV format:

-

-

<​code>​

-

avidemux --load input.avi --audio-process \

-

--audio-normalize --audio-resample \

-

--save-uncompressed-audio /​tmp/​videocd.wav

-

</​code>​

-

-

Then encode it with Lame seperately:

-

-

<​code>​

-

lame /​tmp/​videocd.wav -vbr -v -V 4 \

-

/​tmp/​videocd.mp3

-

</​code>​

-

-

Reload the MP3 and save AVI:

-

-

<​code>​

-

avidemux --load input.avi --external-mp3 /​tmp/​videocd.mp3 \

-

--audio-map --save /​tmp/​new.avi

-

</​code>​

-

-

The audio map is very important as we have generated a VBR MP3. Else expect async big time!

-

-

It is just an example as you can encode to MP3 VBR using the GUI directly.

-

-

==== Batch convert MP4 files to AVI ====

-

-

This example will open the MP4 file safely (if it contains [[tutorial:​H.264]] video or anything else, it does not matter). Then it will save the file into an AVI container, with no modification to the video or audio. The command in general is this:

-

-

<​code>​

-

avidemux2 --force-alt-h264 --load "​video.mp4"​ \

-

--save "​video.avi"​ --output-format AVI --quit

-

</​code>​

-

Here is a small script to process all the MP4 files in the current directory:

-

<code bash>

-

#!/bin/bash

-

VAR="​files.txt"​

-

ls *.mp4 | sort > $VAR # Collect the files in the current directory

-

cat $VAR | while read line; do # Loop read the filenames from the file

-

INPUT=$(echo ${line}) # Grab the nxt new filename

-

OUTPUT=${INPUT%.*4} # Remove shortest match of characters between the '. ' and the '​4'​ at end of string