Using the command line

1. Foreword

    As you probably have noticed, avidemux is very GUI oriented. Because, according to me, when doing video stuff you need to *see* what you are doing. It has a drawback when you went to let the computer work alone by night.

    The ultimate goal is to provide a nice GUI to set up your processing job, and save a job. After that, run avidemux on these jobs and go watch a movie or have a nap.

    We are not that far away. Most of the settings are stored in EDL files.

    Warning: You will still need X11 and gtk1/2 running !



    Avidemux may be called with arguments. The most obvious is avidemux myFile.avi, that will load myFile.avi.

    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: It is very important. For example if you do avidemux2 file.nuv you won't be prompted to save an index.

    To get up to date command list and parameters, just do avidemux --help.

    The args 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.


    Command Parameters Aim
    audio-process None Set the audio to process mode
    audio-normalize None Activate audio normalization filter
    audio-resample None Activate 48 44.1 khz downsampling
    video-process None Set the video to process mode
    filters filename Load a filter set
    vcd-res None Add needed filters to convert to VCD resolution
    svcd-res None Add needed filters to convert to SVCD resolution
    dvd-res None Add needed filters to convert to DVD resolution
    begin Frame number Set the start marker to frame
    end Frame number Set the end marker to frame
    save-raw-audio None Save audio in copy mode
    save-uncompressed-audio None Save audio as pcm is no filter is applied and else apply filters/codec
    save-raw-video None Save elementary video stream and strip the container, you will end up with raw mpeg video!
    index-mpeg mpeg_file index_file tracknumber Create the index for the mpeg file
    load Filename Load a video
    load-workbench Filename Load a workbench/edit list
    save Filename Save the file. Default output format is avi
    save-jpg Filename Save current image as jpeg
    external-mp3 Filename Load the mpeg audio as soundtrack.

    Warning: If VBR you must put a --audio-map afterward

    external-ac3 Filename Load the ac3 file as soundtrack.
    external-wav Filename Load the wav file as soundtrack.
    audio-delay value in ms Shift the audio / video sync by value.
    audio-map None Scan the audio to properly handle VBR audio.
    audio-bitrate value Set the audio bitrate.

    Warning: You must enter a valid audio bitrate!

    audio-codec Audio codec : MP2|MP3|AC3|TOOLAME Select the audio codec that will be used when you set process mode.
    video-codec Divx | Xvid | FFmpeg4 | VCD | SVCD | DVD | XSVCD [ XVCD Select the video codec that will be used when you save in process mode.
    video-conf cq=q | cbr=br | 2pass=xx Select the encoding mode : Constant Quality (cq=quality), constant bitrate (br=bitrate) or 2 pass mode, in that case , give the final size in megabyte.
    output-format AVI|OGM|PS|ES|TS Set the output format. ES is for video only, PS for program stream (VCD/SVCD/DVD) and TS for transport stream.
    auto-split Size in megaBytes Avidemux will automaticallty split the files when they reached the given size and create file.avi, file.avi.1, file.avi.2....The default is 2 gB


Converting AVI file to VCD 

    Encoding the audio with lavcodec : 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

    Encoding the audio with toolame : avidemux2 --load input.avi --audio-process --audio-normalize --audio-resample 44100 --audio-codec TOOLAME --audio-bitrate 224 --output-format PS --video-process --vcd-res --video-codec VCD --save output.mpg --quit

Re-encoding a soundtrack to MP3 VBR 

    First save the audio in wav format avidemux --load input.avi --audio-process --audio-normalize --audio-resample --save-uncompressed-audio /tmp/videocd.wav

    Then encode it with lame : lame /tmp/videocd.wav -vbr -v -V 4 /tmp/videocd.mp3

    Reload the mp3 and save avi : avidemux --load input.avi --external-mp3 /tmp/videocd.mp3 --audio-map --save /tmp/new.avi

    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.