====== Presets ======
Avidemux allows you to store current audio/video encoder and filters settings, which can be used as additional "profiles" for certain target formats (e.g. for playback on portable devices), or simply as your preferred encoder options (so that you don't have to set them manually over and over again).
===== How to store encoder options =====
To store the encoder preset, you have to create a [[using:project files#Custom scripts|custom script]]. As opposed to project files, which contain the complete edit list, custom scripts can contain only the particular settings you are interested in. The easiest way of creating a custom script with your favorite encoder options is setting the options in the graphical user interface, saving the project and then editing the project file (which is an ECMAScript script). Remove everything that's not needed (for example the current loaded file – you want to be able to apply it to any file), leave only the encoder settings in the script. Then save it in the Avidemux directory with custom scripts:
* **Linux/BSD:** ~/.avidemux/custom (".avidemux" is a hidden directory your home directory, so check "Show hidden files" in your file manager)
* **Windows 2000 and XP:** \Documents and Settings\$USER$\Local Settings\Application Data\avidemux\custom
* **Windows Vista:** \Users\$USER$\AppData\Roaming\avidemux\custom
Custom script file names must end with the .js extension. Then you can load the script from the Custom menu in Avidemux.
==== Example – save your x264 options ====
Let's say you want to store your favorite x264 encoder options as a preset:
- Open a video file.
- Select x264 as the video encoder and configure it.
- Save a script: File->Save Project.
- Open the script in a text editor (e.g. Notepad on Windows, gedit in GNOME or Kate in KDE). You will see something like this:
//AD <- Needed to identify//
//--automatically built--
//--Project: /home/user/x264.js
var app = new Avidemux();
//** Video **
// 01 videos source
app.load("/home/user/video.mpeg");
//01 segments
app.clearSegments();
app.addSegment(0,0,1863);
app.markerA=0;
app.markerB=1862;
//** Postproc **
app.video.setPostProc(0,0,0);
app.video.setFps1000(28000);
//** Filters **
//** Video Codec conf **
app.video.codec("X264","AQ=26","188 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 1e 00 00 00 3c 00 00
00 0a 00 00 00 33 00 00 00 04 00 00 00 03 00 00 00 28 00 00 00 19 00 00 00 32 00 00 00 00 00 00 00 01 00
00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 01 00 00 00 04 00 00 00 10 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5a 00 00 00 ");
//** Audio **
app.audio.reset();
app.audio.codec("aac",128,4,"80 00 00 00 ");
app.audio.normalizeMode=0;
app.audio.normalizeValue=0;
app.audio.delay=0;
app.audio.mixer("NONE");
app.setContainer("MP4");
setSuccess(1);
//app.Exit();
//End of script
What you need is those 2 lines:
var app = new Avidemux();
create an Avidemux instance
app.video.codec("X264","AQ=26","188 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 1e 00 00 00 3c 00 00
00 0a 00 00 00 33 00 00 00 04 00 00 00 03 00 00 00 28 00 00 00 19 00 00 00 32 00 00 00 00 00 00 00 01 00
00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 01 00 00 00 04 00 00 00 10 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5a 00 00 00 ");
set the encoder to x264 and store all its options (as you can see, saving the script from the GUI is much easier than having to write all the settings manually)
So your custom script will look like this:
var app = new Avidemux();
app.video.codec("X264","AQ=26","188 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 1e 00 00 00 3c 00 00
00 0a 00 00 00 33 00 00 00 04 00 00 00 03 00 00 00 28 00 00 00 19 00 00 00 32 00 00 00 00 00 00 00 01 00
00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 01 00 00 00 04 00 00 00 10 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5a 00 00 00 ");
Save the file as x264.js in the Avidemux custom directory (see the previous section). When you start Avidemux, x264.js should appear in the Custom menu. Now you should always be able to restore your favorite x264 options by opening Custom->x264.js.