Batch Converting home video AVI files to MP4 with FAAC

Started by knight3330, April 12, 2016, 11:48:16 PM

Previous topic - Next topic

knight3330

Hey guys,

Been reading the forums for a while but did not seem to find my specific issue listed. Hopefully someone with knowledge far greater than I can help with a basic little task I am trying to accomplish.

Before I begin, I should tell you that I am NOT an expert with codes or coding or anything like that. I know how to use the program and fiddle around on the internet to find ways to do stuff better.

The scenario is this:

I have a ton of AVI files I have to convert to MP4 (stupid Apple TV limited junk). Avidemux works GREAT to do that. It is fast, does not require me to re-encode any of the video, and is FREE! I just did a test setup to convert one of the files and it resulted in complete success. The problem is, as the topic subject line implies, is that I need to do this in a batch process way to avoid having to sit at my computer, manually adding and saving dozens and dozens of files.

Here is what I did that worked for a single file. This is exactly what I want to do in the batch process:

1. I opened the AVI file.
2. Set VIDEO to COPY.
3. Set AUDIO to AAC (FAAC).
4. Set OUTPUT FORMAT to MP4 MUXER.
5. Saved the file as an MP4 to my Desktop.

Done!

I tested the file on the Apple TV. Sound and video are great.

I then looked on the interwebs for a few tools to automate the process for the next 3000 jobs (not really 3000, but a lot). Here is a bunch of code that I found and created a CONVERT.BAT file to run it.

set avidemux="C:\Program Files\Avidemux 2.6 - 64 bits\avidemux.exe"
set videocodec=copy
set audiocodec=aac
for %%f in (*.avi) do %avidemux% --video-codec %videocodec% --audio-codec %audiocodec% --autoindex  --load "%%f" --output-format MP4 --save "%%f.mp4" --quit


All I needed to do was to put the CONVERT.BAT in the same folder as the target AVI files and run it. It went through all the files and outputted 20+ MP4 files. They all played fine on my Apple TV, except that they had no sound. So, I looked at the code and found that perhaps it was the lack of an "faac" designation, since that was all I could see that I was doing differently.

So I changed the code to:

set audiocodec=faac

Re-ran the test. Did not work. Same result.

That's when I decided to register an account on this site and ask this question. Any cool dudes or girls out there that can help?

Jan Gruuthuse

#1
could you try with either
set audiocodec= LavAAC or set audiocodec= Faac

and
set outputformat=MP4V2 or set outputformat=MP4

Change
Quote--output-format MP4
to
Quote--output-format %outputformat%

If above would fail you would need to work with loading a Tinypy project file, with this parameter:
Quote--run "AAC(Faac)MP4.py"
where AAC(Faac)MP4.py is the name used for the wanted project file.
for %%f in (*.avi) do %avidemux% --load "%%f" --run "AAC(Faac)MP4.py" --save "%%f.mp4" --quit

find attached Tinypy for audiocodec (Faac or lav) and container (mp4 or mp4v2)
- AAC(Faac) MP4
- AAC(lav) MP4
- AAC(Faac) MP4v2
- AAC(lav) MP4v2