User Tools

Site Tools


This is an old revision of the document!

Batch processing

This page tries to explain how batch processing works with Avidemux.

This tutorial shows how one can process multiple video files with same settings. This is useful for cases where you have to e.g. convert multiple video files to certain format.

Short introduction to different methods

Since AVIdemux supports both Command-line processing (command_line_usage) and JS scripting (Scripting) possibilities, there are multiple ways to batch process your files: 1. Command-line only processing with bash script/.bat file or similar. 2. JS scripting only processing 3. Combination of command-line and JS scripting

Command-line only batch processing

AVIdemux command-line support doesn't allow you to change all possible options. But it usually works OK for simple format conversions. Since it allows you to use additional command-line tools, you can for example automate YouTube uploads after AVIdemux has processed the files. Because different operating systems and shells have different kind of filename limits, commands etc. some command-line samples presented below won't work in all systems/shells.

Win32 example (.bat file) that will convert all .mp4 files in current folder to .avi (XviD+MP3). Original files aren't modified. New files are named like something.mp4.avi

set avidemux="C:\Program Files\Avidemux 2.5\avidemux2.exe"
set videocodec=Xvid
set audiocodec=MP3
for %%f in (*.mp4) do %avidemux% --video-codec %videocodec% --audio-codec %audiocodec% --force-alt-h264 --load "%%f" --save "%%f.avi" --quit

(you should change “C:\Program Files\Avidemux 2.5\avidemux2.exe” in case your AVIdemux installation is located in different folder) You can copy that text to new text file, then rename the text file to something.bat and move it to the folder where you want to process the files. Then just double click the something.bat and processing should start.

If you want to force certain bitrate for audio and video, do following

set avidemux="C:\softa\avidemux_r6854\avidemux2.exe"
set videocodec=Xvid
set videobitrate=cbr=512
set audiocodec=MP3
set audiobitrate=64
for %%f in (*.mp4) do %avidemux% --video-codec %videocodec% --video-conf %videobitrate% --audio-codec %audiocodec% --audio-bitrate %audiobitrate% --force-alt-h264 --load "%%f" --save "%%f.avi" --quit

JS scripting only batch processing

Since AVIdemux supports JS scripting, you can create scripts with it also. These script can be loaded from command-line (–run) or from GUI (File → Load/Run project…). Since environment is same on all platforms, the scripts are quite portable. Only problematic part is slashing since some operating systems assume / is the proper one and few systems think \ is the right one.

tutorial/batch_processing.1294507710.txt.gz · Last modified: 2012/11/11 08:51 (external edit)