News:

--

Main Menu

Error applying audio codec

Started by Varro, November 26, 2017, 06:00:34 PM

Previous topic - Next topic

dosdan

#15
Quoteset avidemux="c:\Program Files\Avidemux 2.7 - 64 bits\avidemux.exe"
set project="path\to\edited\script.py"

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 test.mov.mp4 from test.mov

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.

MOV_to_MP4.bat
@echo off
set avidemux="C:\Program Files\Avidemux 2.7 - 64 bits\avidemux.exe"
set project="D:\ADM Test\test.py"
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:
http://avidemux.org/smif/index.php/topic,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:
http://avidemux.org/smif/index.php/topic,17187.msg77356.html#msg77356


Dan.