Author Topic: Error applying audio codec  (Read 3005 times)


  • Full Member
  • ***
  • Posts: 182
Re: Error applying audio codec
« Reply #15 on: November 27, 2017, 08:19:47 PM »
Code: [Select]
set avidemux="c:\Program Files\Avidemux 2.7 - 64 bits\avidemux.exe"
set project="path\to\edited\"

for %%f in (*.MOV) do %avidemux% --load "%%f" --run %project% --save "%%f.mp4" --quit

I wouldn't use "%%f.mp4" here as it will create from

To not include the orgiinal file extension under Windows, instead use "%%~nf"

Here's a slightly more complex version of this batchfile, designed to use as a icon on the Windows desktop. You drag one or more MOV files onto it. It uses a sub-directory called "processed videos" beneath the directory where the MOVs were dragged from, and creates this sub-directory if it doesn't already exist.

Code: [Select]
@echo off
set avidemux="C:\Program Files\Avidemux 2.7 - 64 bits\avidemux.exe"
set project="D:\ADM Test\"
set output_dir=processed videos\
if not exist "%output_dir%" md "%output_dir%"

for %%f in (*.mov) do %avidemux% --load "%%f" --run %project% --save "%output_dir%%%~nf.mp4" --quit

A variation would be to use the same output directory for all conversions e.g.
set output_dir=D:\processed videos\
But you might sometimes have problems with duplicated processed filenames.

Another variation would be to test for an errorlevel and, if no err occurred, to delete the original file after the conversion, as here:,17148.msg77044.html#msg77044
But I'm not sure if ADM sets an errorlevel in CLI mode.

Or, show the new file details, as displayed in a DIR line listing, as a crude type of multi-file conversion progress indicator, as each one is converted, as here:,17187.msg77356.html#msg77356


« Last Edit: November 27, 2017, 08:52:45 PM by dosdan »