Avidemux Forum

Avidemux => Windows => Topic started by: Ineedcoffee on February 17, 2013, 10:33:15 AM

Title: Batch convert MKV to MP4 with AAC crashing
Post by: Ineedcoffee on February 17, 2013, 10:33:15 AM
Hi,

I am quite new to all of this however I created a bat file to batch convert some mkv's to mp4's whilst also converting the audio to AAC. It keeps on crashing as soon as it is run, here is my code;

set avidemux="C:\Program Files (x86)\Avidemux 2.5\avidemux2.exe"
set audiocodec=AAC
set outputformat=MP4
for %%f in (*.mkv) do %avidemux% --output-format MP4 --audio-codec %audiocodec% --force-alt-h264 --load "%%f" --save "%%f.mp4"


I can't see any reason that this does not work. The program loads however crashes as soon as it is about to start converting. I am running Win7 64.

Any help would be greatly appreciated.

Thanks.
Title: Re: Batch convert MKV to MP4 with AAC crashing
Post by: Jan Gruuthuse on February 17, 2013, 12:58:44 PM
When doing it manual in avidemux GUI 2.5, does it work? What version exactly are you using?
Myself found it easier to set the wanted parameters in avidemux (2.6.1) with saving as project, edit out load references to video in the project, calling the settings back from a batch (windows) script (linux). Should be very similar.
Important for 2.6.1 is to remake previously made projects in 2.6.0/1 and resave these. Some small differences do exist between current version and previous ones.
Main source: Combination of command-line and JS scripting (http://www.avidemux.org/admWiki/doku.php?id=tutorial:batch_processing#combination_of_command-line_and_js_scripting)
look for --run something.js something would be a saved project!
Example for switching audio tracks: 2.6 audio track switching in job.py (http://www.avidemux.org/smf/index.php/topic,10499.0.html)
Title: Re: Batch convert MKV to MP4 with AAC crashing
Post by: styrol on February 17, 2013, 02:00:33 PM
Quote from: Ineedcoffee on February 17, 2013, 10:33:15 AM
set avidemux="C:\Program Files (x86)\Avidemux 2.5\avidemux2.exe"
set audiocodec=AAC
set outputformat=MP4
for %%f in (*.mkv) do %avidemux% --output-format MP4 --audio-codec %audiocodec% --force-alt-h264 --load "%%f" --save "%%f.mp4"

I assume AAC codec has to be specified:
"audiocodec=LavAAC"
or
"audiocodec=Faac"
Title: Re: Batch convert MKV to MP4 with AAC crashing
Post by: Ineedcoffee on February 18, 2013, 07:46:04 PM
Thanks for the reply's. I'm using 2.5.6 and setting it in the GUI does work. I just do Video Copy and Audio AAC (Facc) (also change filters to stereo and dynamic range compression) and this works fine.

I tried changing the AAC to LavAAC and Faac as you suggested styrol but it just comes up with audi codec errors