Batch processing video files with Avidemux

Avidemux is great for simple video editing jobs. I often use it to extract clips from longer videos while retaining their native encoding, or to convert videos from one format to another.

Today I learned something really useful and wanted to write up a post about it.

Batch processing multiple videos

Step 1. Get one video exported the way you want it, then save the settings as a Project file (File > Project script > Save as project).

Step 2. Edit the .py file and remove the following lines that are specific to the source video:

adm.loadVideo
adm.clearSegments
adm.addSegment
adm.markerA
adm.markerB

Step 3. Write a script to process the video file(s).

Linux (Bash script)

This script processes one video at a time.

avidemux3_cli --load [source-file.vob] --run [project-settings.py] --save [output-file.mkv] --quit

Windows (batch file)

This script will run on all MP4, MOV, and MTS files in the current folder.

set avidemux="C:\[path-to-Avidemux]\Avidemux.exe"
: %%~nf returns the filename without the extension
for %%f in (*.mp4 *.mov *.mts) do (
	%avidemux% --load "%%f" --run settings.py --save "%%~nf.mkv" --quit
)