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

dosdan

  • Jr. Member
  • **
  • Posts: 63
Re: Error applying audio codec
« Reply #15 on: November 27, 2017, 08:19:47 PM »
Quote
Code: [Select]
set 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
Code: [Select]
@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.

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