User Tools

Site Tools


using:command_line_usage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
using:command_line_usage [2010/04/15 14:36]
j.m created
using:command_line_usage [2016/06/20 10:42]
mean
Line 5: Line 5:
 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.
  
-workbench ​file is a project ​file. The term workbench refers to the currently active video and settings in the programWhen you save workbench you are really saving ​it to a project file.+project ​file is a file containing all settings ​and loaded filesIt is "​snapshot"​ of avidemux state at the point it was saved.
  
 ===== Commands ===== ===== Commands =====
  
-To get up to date command list and parameters, just invoke Avidemux with the argument //--help//.+To get up to date command list and parameters, just invoke Avidemux with the argument //<​nowiki>​--</​nowiki>​help//.
  
 ^Audio commands ​ ^Parameters ​ ^Description ​ ^ ^Audio commands ​ ^Parameters ​ ^Description ​ ^
-|--audio-bitrate ​ |value ​ |Set the audio bitrate. Warning: You must enter valid audio bitrate! ​ | +|<​nowiki>​--</​nowiki>​audio-bitrate ​ |value ​ |Set the audio bitrate. ​**Warning: You must enter valid audio bitrate!**  | 
-|--audio-codec ​ |Audio codec: MP2 <​nowiki>​|</​nowiki>​ MP3 <​nowiki>​|</​nowiki>​ AC3 <​nowiki>​|</​nowiki>​ TWOLAME ​ |Select the audio codec that will be used when you set process mode.  | +|<​nowiki>​--</​nowiki>​audio-codec ​ |Audio codec: MP2 <​nowiki>​|</​nowiki>​ MP3 <​nowiki>​|</​nowiki>​ AC3 <​nowiki>​|</​nowiki>​ TWOLAME ​ |Select the audio codec that will be used when you set process mode.  | 
-|--audio-delay ​ |value in ms (milliseconds) ​ |Shift the audio/video sync by value. ​ | +|<​nowiki>​--</​nowiki>​audio-delay ​ |value in ms (milliseconds) ​ |Shift the audio/video sync by value. ​ | 
-|--audio-downsample ​ |none  |Activate 48 kHz to 44.1 kHz downsampling. ​ | +|<​nowiki>​--</​nowiki>​audio-downsample ​ |none  |Activate 48 kHz to 44.1 kHz downsampling. ​ | 
-|--audio-normalize ​ |none  |Activate audio normalization filter. ​ | +|<​nowiki>​--</​nowiki>​audio-normalize ​ |none  |Activate audio normalization filter. ​ | 
-|--audio-map ​ |none  |Scan the audio to properly handle VBR audio. ​ | +|<​nowiki>​--</​nowiki>​audio-map ​ |none  |Scan the audio to properly handle VBR audio. ​ | 
-|--audio-mono2stereo ​ |none  |Channels: convert mono to stereo. ​ | +|<​nowiki>​--</​nowiki>​audio-mono2stereo ​ |none  |Channels: convert mono to stereo. ​ | 
-|--audio-resample ​ |desired resample frequency ​ |Resample to '​X'​ kHz.  | +|<​nowiki>​--</​nowiki>​audio-resample ​ |desired resample frequency ​ |Resample to '​X'​ kHz.  | 
-|--audio-stereo2mono ​ |none  |Channels: convert stereo to mono.  | +|<​nowiki>​--</​nowiki>​audio-stereo2mono ​ |none  |Channels: convert stereo to mono.  | 
-|--no-audio ​ |none  |Disable internal audio. Useful if you want to use only external audio files. ​ |+|<​nowiki>​--</​nowiki>​no-audio ​ |none  |Disable internal audio. Useful if you want to use only external audio files. ​ |
 ^Audio output commands ​ ^Parameters ​ ^Description ​ ^ ^Audio output commands ​ ^Parameters ​ ^Description ​ ^
-|--save-raw-audio ​ |filename ​ |Save output audio in copy mode, same audio as input audio. ​ | +|<​nowiki>​--</​nowiki>​save-raw-audio ​ |filename ​ |Save output audio in copy mode, same audio as input audio. ​ | 
-|--save-uncompressed-audio ​ |filename ​ |Save audio as PCM. Default is no filters, but they can be applied. ​ |+|<​nowiki>​--</​nowiki>​save-uncompressed-audio ​ |filename ​ |Save audio as PCM. Default is no filters, but they can be applied. ​ |
 ^External audio commands ​ ^Parameters ​ ^Description ​ ^ ^External audio commands ​ ^Parameters ​ ^Description ​ ^
-|--external-mp3 ​ |filename ​ |Load the MPEG audio as soundtrack. Warning: If VBR, you must put a --audio-map afterward. ​ | +|<​nowiki>​--</​nowiki>​external-mp3 ​ |filename ​ |Load the MPEG audio as soundtrack. ​**Warning: If VBR, you must put a <​nowiki>​--</​nowiki>​audio-map afterward.**  | 
-|--external-ac3 ​ |filename ​ |Load the AC3 file as soundtrack. ​ | +|<​nowiki>​--</​nowiki>​external-ac3 ​ |filename ​ |Load the AC3 file as soundtrack. ​ | 
-|--external-wav ​ |filename ​ |Load the WAV file as soundtrack. ​ |+|<​nowiki>​--</​nowiki>​external-wav ​ |filename ​ |Load the WAV file as soundtrack. ​ |
 ^Video commands ​ ^Parameters ​ ^Description ​ ^ ^Video commands ​ ^Parameters ​ ^Description ​ ^
-|--video-codec ​ |XVID4 <​nowiki>​|</​nowiki>​ x264 <​nowiki>​|</​nowiki>​ FFmpeg4 <​nowiki>​|</​nowiki>​ VCD <​nowiki>​|</​nowiki>​ SVCD <​nowiki>​|</​nowiki>​DVD <​nowiki>​|</​nowiki>​ XSVCD <​nowiki>​|</​nowiki>​ XVCD  |Select the video codec that will be used when you save in process mode.  | +|<​nowiki>​--</​nowiki>​video-codec ​ |XVID4 <​nowiki>​|</​nowiki>​ x264 <​nowiki>​|</​nowiki>​ FFmpeg4 <​nowiki>​|</​nowiki>​ VCD <​nowiki>​|</​nowiki>​ SVCD <​nowiki>​|</​nowiki>​DVD <​nowiki>​|</​nowiki>​ XSVCD <​nowiki>​|</​nowiki>​ XVCD  |Select the video codec that will be used when you save in process mode.  | 
-|--video-conf ​ |cq=q <​nowiki>​|</​nowiki>​ cbr=br <​nowiki>​|</​nowiki>​ 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 megabytes. ​ | +|<​nowiki>​--</​nowiki>​video-conf ​ |cq=q <​nowiki>​|</​nowiki>​ cbr=br <​nowiki>​|</​nowiki>​ 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 megabytes. ​ | 
-|--set-pp ​ |Two arguments: value (1=hdeblok<​nowiki>​|</​nowiki>​2=vdeblock<​nowiki>​|</​nowiki>​4=dering) & strength (0-5)  |Set the default post-processing value. ​ |+|<​nowiki>​--</​nowiki>​set-pp ​ |Two arguments: value (1=hdeblok<​nowiki>​|</​nowiki>​2=vdeblock<​nowiki>​|</​nowiki>​4=dering) & strength (0-5)  |Set the default post-processing value. ​ |
 ^Filter commands ​ ^Parameters ​ ^Description ​ ^ ^Filter commands ​ ^Parameters ​ ^Description ​ ^
-|--filters ​ |filename ​ |Load a filter set.  | +|<​nowiki>​--</​nowiki>​filters ​ |filename ​ |Load a filter set.  | 
-|--listfilters ​ |none  |List all filters by name.  |+|<​nowiki>​--</​nowiki>​listfilters ​ |none  |List all filters by name.  |
 ^Codec configuration commands ​ ^Parameters ​ ^Description ​ ^ ^Codec configuration commands ​ ^Parameters ​ ^Description ​ ^
-|--codec-conf ​ |codec-config-filename ​ |Load a codec configuration. ​ |+|<​nowiki>​--</​nowiki>​codec-conf ​ |codec-config-filename ​ |Load a codec configuration. ​ |
 ^Resolution commands ​ ^Parameters ​ ^Description ​ ^ ^Resolution commands ​ ^Parameters ​ ^Description ​ ^
-|--dvd-res ​ |none  |Sets DVD resolution by adding needed filters for conversion. ​ | +|<​nowiki>​--</​nowiki>​dvd-res ​ |none  |Sets DVD resolution by adding needed filters for conversion. ​ | 
-|--svcd-res ​ |none  |Sets SVCD resolution by adding needed filters for conversion. ​ | +|<​nowiki>​--</​nowiki>​svcd-res ​ |none  |Sets SVCD resolution by adding needed filters for conversion. ​ | 
-|--halfd1-res ​ |none  |Sets 1/2 DVD resolution by adding needed filters for conversion. ​ | +|<​nowiki>​--</​nowiki>​halfd1-res ​ |none  |Sets 1/2 DVD resolution by adding needed filters for conversion. ​ | 
-|--vcd-res ​ |none  |Sets VCD resolution by adding needed filters for conversion. ​ |+|<​nowiki>​--</​nowiki>​vcd-res ​ |none  |Sets VCD resolution by adding needed filters for conversion. ​ |
 ^Start/​finish commands ​ ^Parameters ​ ^Description ​ ^ ^Start/​finish commands ​ ^Parameters ​ ^Description ​ ^
-|--begin ​ |frame number ​ |Set the start marker to frame. ​ | +|<​nowiki>​--</​nowiki>​begin  |frame number ​ |Set the start marker to frame. ​ | 
-|--end ​ |frame number ​ |Set the end marker to frame. ​ |+|<​nowiki>​--</​nowiki>​end  |frame number ​ |Set the end marker to frame. ​ |
 ^Load commands ​ ^Parameters ​ ^Description ​ ^ ^Load commands ​ ^Parameters ​ ^Description ​ ^
-|--load ​ |filename ​ |Load a video file.  | +|<​nowiki>​--</​nowiki>​load  |filename ​ |Load a video file.  | 
-|--load-workbench ​ |filename ​ |Load a workbench/​edit list.  |+|<​nowiki>​--</​nowiki>​load-workbench ​ |filename ​ |Load a workbench/​edit list.  |
 ^Misc. commands ​ ^Parameters ​ ^Description ​ ^ ^Misc. commands ​ ^Parameters ​ ^Description ​ ^
-|--append ​ |video filename ​ |Append a video file to the current video  | +|<​nowiki>​--</​nowiki>​append ​ |video filename ​ |Append a video file to the current video  | 
-|--autoindex ​ |none  |Try to generate required index files as necessary ​ | +|<​nowiki>​--</​nowiki>​autoindex ​ |none  |Try to generate required index files as necessary ​ | 
-|--force-b-frame ​ |none  |Force detection of b-frame in next loaded file  | +|<​nowiki>​--</​nowiki>​force-b-frame ​ |none  |Force detection of b-frame in next loaded file  | 
-|--force-alt-h264 ​ |none  |Force use of alternate safe read mode for h264 video. Warning: This argument must be used before --load to be effective. ​ | +|<​nowiki>​--</​nowiki>​force-alt-h264 ​ |none  |Force use of alternate safe read mode for h264 video. ​**Warning: This argument must be used before ​<​nowiki>​--</​nowiki>​load to be effective.**  | 
-|--force-smart ​ |none  |Engage smart copy mode with CQ=3 at next save  | +|<​nowiki>​--</​nowiki>​force-smart ​ |none  |Engage smart copy mode with CQ=3 at next save  | 
-|--force-unpack ​ |none  |Force detection of packed VOP in next loaded file  | +|<​nowiki>​--</​nowiki>​force-unpack ​ |none  |Force detection of packed VOP in next loaded file  | 
-|--fps ​ |value ​ |Set the frame rate per second of the workbench ​ | +|<​nowiki>​--</​nowiki>​fps  |value ​ |Set the frame rate per second of the workbench ​ | 
-|--index-mpeg ​ |MPEG_file INDEX_file TrackNumber ​ |Create index for the MPEG file.  | +|<​nowiki>​--</​nowiki>​index-mpeg ​ |MPEG_file INDEX_file TrackNumber ​ |Create index for the MPEG file.  | 
-|--info ​ |none  |Show information about loaded video and audio streams ​ | +|<​nowiki>​--</​nowiki>​info  |none  |Show information about loaded video and audio streams ​ | 
-|--rebuild-index ​ |none  |Rebuild index with correct frame type.  | +|<​nowiki>​--</​nowiki>​rebuild-index ​ |none  |Rebuild index with correct frame type.  | 
-|--reuse-2pass-log ​ |none  |Reuse the 2-pass logfile if it exists. ​ | +|<​nowiki>​--</​nowiki>​reuse-2pass-log ​ |none  |Reuse the 2-pass logfile if it exists. ​ | 
-|--run ​ |script filename ​ |Load and run a script. ​ | +|<​nowiki>​--</​nowiki>​run  |script filename ​ |Load and run a script. ​ | 
-|--save-jpg ​ |output filename ​ |Save current video frame image as a JPEG file.  | +|<​nowiki>​--</​nowiki>​save-jpg ​ |output filename ​ |Save current video frame image as a JPEG file.  | 
-|--save-workbench ​ |output filename ​ |Save the current workbench into a project file.  | +|<​nowiki>​--</​nowiki>​save-workbench ​ |output filename ​ |Save the current workbench into a project file.  | 
-|--var ​ |my_var_name=value ​ |Set variable value. ​ |+|<​nowiki>​--</​nowiki>​var  |my_var_name=value ​ |Set variable value. ​ |
 ^Output save commands ​ ^Parameters ​ ^Description ​ ^ ^Output save commands ​ ^Parameters ​ ^Description ​ ^
-|--save filename ​ |Save the file.  |Default output format is AVI.  | +|<​nowiki>​--</​nowiki>​save  |filename ​ |Save the file. Default output format is AVI.  | 
-|--save-dvd ​ |(two args)  |Save as DVD MPEG PS.  | +|<​nowiki>​--</​nowiki>​save-dvd ​ |(two args)  |Save as DVD MPEG PS.  | 
-|--save-unpacked-vop ​ |filename ​ |Save as AVI with unpacked VOP.  | +|<​nowiki>​--</​nowiki>​save-unpacked-vop ​ |filename ​ |Save as AVI with unpacked VOP.  | 
-|--save-ogm ​ |filename ​ |Save as OGM file.  | +|<​nowiki>​--</​nowiki>​save-ogm ​ |filename ​ |Save as OGM file.  | 
-|--save-raw-video ​ |none  |Save elementary video stream and strip the container, you will end up with raw MPEG video! ​ | +|<​nowiki>​--</​nowiki>​save-raw-video ​ |none  |Save elementary video stream and strip the container, you will end up with raw MPEG video! ​ | 
-|--output-format ​ |AVI <​nowiki>​|</​nowiki>​ AVI_DUAL <​nowiki>​|</​nowiki>​ AVI_UNP <​nowiki>​|</​nowiki>​ ES <​nowiki>​|</​nowiki>​ MP4 <​nowiki>​|</​nowiki>​ OGM <​nowiki>​|</​nowiki>​ PS <​nowiki>​|</​nowiki>​ TS  |Set the output format. ES is for video only, PS for Program Stream (VCD/​SVCD/​DVD) and TS for Transport Stream. ​ | +|<​nowiki>​--</​nowiki>​output-format ​ |AVI <​nowiki>​|</​nowiki>​ AVI_DUAL <​nowiki>​|</​nowiki>​ AVI_UNP <​nowiki>​|</​nowiki>​ ES <​nowiki>​|</​nowiki>​ MP4 <​nowiki>​|</​nowiki>​ OGM <​nowiki>​|</​nowiki>​ PS <​nowiki>​|</​nowiki>​ TS <​nowiki>​|</​nowiki>​ MATROSKA ​ |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 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 [[H264|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 
-  OUTPUT+="​.avi"​ # Append new extension 
-  avidemux2 --force-alt-h264 --load "​$INPUT"​ --save "​$OUTPUT"​ --output-format AVI --quit ​ 
-done 
-rm $VAR # Remove the text file with the file names 
-</​code>​ 
using/command_line_usage.txt · Last modified: 2016/06/20 10:42 by mean