Author Topic: Batch convert MKV to MP4 with AAC crashing  (Read 6139 times)

Ineedcoffee

  • Newbie
  • *
  • Posts: 2
Batch convert MKV to MP4 with AAC crashing
« 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;

Code: [Select]
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.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: Batch convert MKV to MP4 with AAC crashing
« Reply #1 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
look for
Code: [Select]
--run something.js something would be a saved project!
Example for switching audio tracks: 2.6 audio track switching in job.py

styrol

  • Hero Member
  • *****
  • Posts: 533
Re: Batch convert MKV to MP4 with AAC crashing
« Reply #2 on: February 17, 2013, 02:00:33 PM »
Code: [Select]
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"

Ineedcoffee

  • Newbie
  • *
  • Posts: 2
Re: Batch convert MKV to MP4 with AAC crashing
« Reply #3 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