Kodi Community Forum

Full Version: Linux Script to Convert AAC Audio to AC3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm trying to see if there's any interest in a script I'm working on to convert MKV & MP4 files with AAC audio to AC3 audio. Basically I found myself in a situation where more and more of my video files contain 5.1 channel AAC audio, however, since I don't have a receiver that can take HDMI audio, I found myself having to play these AAC files in stereo over my SPDIF link (since XBMC is not able to transcode AAC to AC3). If I want to listed to AAC in surround sound, I have to either purchase a HDMI enabled receiver and pipe the audio out over HDMI or figure out a way to convert AAC audio to AC3.

There's a couple of tools available that will do just that, but they are all Windows based, so I set out to put a script together to do the exact same thing but in Linux. I've got a basic working copy already, it just needs lots of fine tuning and fool proofing.

I started this thread to see if there's any interest in what I'm doing and if there is I'll provide lots more info ... otherwise I'll just probably post the finished script in a few days/weeks and if anyone down the roads wants to use it then great.

Thanks,
Harry
Here's a copy of my script. Should be fairly well tested and debugged. Just copy and paste the code below into a file called AAC2AC3, make sure it's executable and you're set. Please let me know if you have any issues with it or find any bugs, etc.

Thanks,
Harry

Code:
#!/bin/bash
# ----------
# This script takes a MP4 or MKV file with an AAC audio track as input and
#    outputs an MKV file with an AC3 audio track added on
# ----------
# Needed tools:
# MKVToolnix (install Ubuntu mkvtoolnix package)
# FAAD2 (install Ubuntu faad package)
# Aften (install Ubuntu aften package)
# ----------
# Usage:
# AAC2AC3 Input_File Output_File Optional_Working_Directory
# ----------

# initialize variables
INPUT=$1
OUTPUT=$2
WORKDIR=$3

# make things a bit more pretty
echo

# make sure all programs we need are installed
if ! which mkvmerge mkvextract &> /dev/null
then
   echo "MKVToolnix is missing.  Please install the mkvtoolnix package."
   echo
   exit 1
fi
if ! which faad &> /dev/null
then
   echo "FAAD2 is missing.  Please install the faad package."
   echo
   exit 1
fi
if ! which aften &> /dev/null
then
   echo "Aften is missing.  Please install the aften package."
   echo
   exit 1
fi

# make sure passed variables make sense
if [ ! "$INPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "No input file specified."
   echo
   exit 1
fi
if [ ! -f "$INPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "Specified input file doesn't exist."
   echo
   exit 1
fi
if [ ! "$OUTPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "No output file specified."
   echo
   exit 1
fi
if [ -e "$OUTPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "Specified output file already exists."
   echo
   exit 1
fi
if [ ! "$WORKDIR" ]
then
   WORKDIR="`pwd`"
fi
if [ ! -d "$WORKDIR" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "Specified working directory doesn't exist."
   echo
   exit 1
fi

# check if any temp files are already present
if [ -e "$WORKDIR/AAC2AC3Temp.mkv" ] || [ -e "$WORKDIR/AAC2AC3Temp.aac" ] || [ -e "$WORKDIR/AAC2AC3Temp.ac3" ]
then
   echo "Files AAC2AC3Temp.mkv and/or AAC2AC3Temp.aac and/or AAC2AC3Temp.ac3 already"
   echo "exist in the working directory.  These will be overwritten."
   echo
   echo -n "Continue (y/n)?: "
   read CONTINUE
   echo
   if ! ([ "$CONTINUE" == "y" ] || [ "$CONTINUE" == "Y" ])
   then
      echo
      exit 1
   fi
fi

# check if the input file is an MP4 file
if [[ "$INPUT" == *.mp4 ]]
then
   mkvmerge -o "$WORKDIR/AAC2AC3Temp.mkv" "$INPUT"
   INPUT="$WORKDIR/AAC2AC3Temp.mkv"
   echo
   echo "**********"
   echo
fi

# print out details about the file in question
mkvmerge -i "$INPUT"

# ask which track we are converting
echo
echo -n "Please specify AAC track to be converted (look for the (A_AAC) label): "
read TRACK
echo

# check if the track was properly specified
if [ "`expr $TRACK - $TRACK 2> /dev/null`" != "0" ]
then
   echo "Specified track has to be a numeric value."
   echo
   exit 1
fi
if [ $TRACK -lt 1 ]
then
   echo "Specified track can not be less than one."
   echo
   exit 1
fi

# extract the specified track
mkvextract tracks "$INPUT" $TRACK:"$WORKDIR/AAC2AC3Temp.aac"

# make things pretty
echo
echo "**********"

# convert to wave and pipe to AC3 encoder
faad -q -f 2 -w "$WORKDIR/AAC2AC3Temp.aac" | aften -v 1 -raw_ch 6 - "$WORKDIR/AAC2AC3Temp.ac3"

# make things pretty
echo "**********"
echo

# merge everything back together
mkvmerge -o "$OUTPUT" "$INPUT" "$WORKDIR/AAC2AC3Temp.ac3"

# make things pretty
echo

# clean up temp files
rm -f "$WORKDIR/AAC2AC3Temp.mkv"
rm -f "$WORKDIR/AAC2AC3Temp.aac"
rm -f "$WORKDIR/AAC2AC3Temp.ac3"

# all done
exit 0

P.S. I'm still tweaking some of the settings used during conversion to see if I can get better quality and I also still have to confirm all channels are converted properly (ie: front left AAC = front left AC3, etc.)
Here's the updated script. I've tweaked the quality settings to get the best possible quality out of the conversion. Only thing left is to make 100% sure that the channels are mapped correctly after the conversion.

Thanks,
Harry

Code:
#!/bin/bash
# ----------
# This script takes a MP4 or MKV file with an AAC audio track as input and
#    outputs an MKV file with an AC3 audio track added on
# ----------
# Needed tools:
# MKVToolnix (install Ubuntu mkvtoolnix package)
# FAAD2 (install Ubuntu faad package)
# Aften (install Ubuntu aften package)
# ----------
# Usage:
# AAC2AC3 Input_File Output_File Optional_Working_Directory
# ----------

# initialize variables
INPUT=$1
OUTPUT=$2
WORKDIR=$3

# make things a bit more pretty
echo

# make sure all programs we need are installed
if ! which mkvmerge mkvextract &> /dev/null
then
   echo "MKVToolnix is missing.  Please install the mkvtoolnix package."
   echo
   exit 1
fi
if ! which faad &> /dev/null
then
   echo "FAAD2 is missing.  Please install the faad package."
   echo
   exit 1
fi
if ! which aften &> /dev/null
then
   echo "Aften is missing.  Please install the aften package."
   echo
   exit 1
fi

# make sure passed variables make sense
if [ ! "$INPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "No input file specified."
   echo
   exit 1
fi
if [ ! -f "$INPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "Specified input file doesn't exist."
   echo
   exit 1
fi
if [ ! "$OUTPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "No output file specified."
   echo
   exit 1
fi
if [ -e "$OUTPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "Specified output file already exists."
   echo
   exit 1
fi
if [ ! "$WORKDIR" ]
then
   WORKDIR="`pwd`"
fi
if [ ! -d "$WORKDIR" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "Specified working directory doesn't exist."
   echo
   exit 1
fi

# check if any temp files are already present
if [ -e "$WORKDIR/AAC2AC3Temp.mkv" ] || [ -e "$WORKDIR/AAC2AC3Temp.aac" ] || \
   [ -e "$WORKDIR/AAC2AC3Temp.ac3" ]
then
   echo "Files AAC2AC3Temp.mkv and/or AAC2AC3Temp.aac and/or AAC2AC3Temp.ac3 already"
   echo "exist in the working directory.  These will be overwritten."
   echo
   echo -n "Continue (y/n)?: "
   read CONTINUE
   echo
   if ! ([ "$CONTINUE" == "y" ] || [ "$CONTINUE" == "Y" ])
   then
      echo
      exit 1
   fi
fi

# check if the input file is an MP4 file
if [[ "$INPUT" == *.mp4 ]] || [[ "$INPUT" == *.MP4 ]]
then
   mkvmerge -o "$WORKDIR/AAC2AC3Temp.mkv" "$INPUT"
   INPUT="$WORKDIR/AAC2AC3Temp.mkv"
   echo
   echo "**********"
   echo
fi

# print out details about the file in question
mkvmerge -i "$INPUT"

# ask which track we are converting
echo
echo -n "Please specify AAC track to be converted (look for the (A_AAC) label): "
read TRACK
echo

# check if the track was properly specified
if [ "`expr $TRACK - $TRACK 2> /dev/null`" != "0" ]
then
   echo "Specified track has to be a numeric value."
   echo
   exit 1
fi
if [ $TRACK -lt 1 ]
then
   echo "Specified track can not be less than one."
   echo
   exit 1
fi

# extract the specified track
mkvextract tracks "$INPUT" $TRACK:"$WORKDIR/AAC2AC3Temp.aac"

# make things pretty
echo
echo "**********"

# confirm audio sample rate
echo
echo -n "Please specify audio track sample rate (press enter for default of 48000Hz):"
read RATE

# setup default sample rate if needed
if [ ! $RATE ]
then
   RATE=48000
fi

# check if the rate was properly specified
if [ "`expr $RATE - $RATE 2> /dev/null`" != "0" ]
then
   echo "Specified sample rate has to be a numeric value."
   echo
   exit 1
fi
if [ $RATE -lt 1 ]
then
   echo "Specified sample rate can not be less than one."
   echo
   exit 1
fi

# confirm number of audio channels
echo
echo "Please specify the number of channels in audio track (press enter for"
echo -n "default of 6 channels):"
read CHANNELS

# setup default number of channels if needed
if [ ! $CHANNELS ]
then
   CHANNELS=6
fi

# check if the rate was properly specified
if [ "`expr $CHANNELS - $CHANNELS 2> /dev/null`" != "0" ]
then
   echo "Specified number of channels has to be a numeric value."
   echo
   exit 1
fi
if [ $CHANNELS -lt 1 ]
then
   echo "Specified number of channels can not be less than one."
   echo
   exit 1
fi

# faad outputs a raw 24 bit PCM stream (anything higher than 24 bits seems to
# introduce anomalies) which is then piped to aften and converted to a 640 kbit/s
# AC3 stream (640 kbit/s is max allowed and yields highest possible quality)
faad -b 2 -f 2 -q -w "$WORKDIR/AAC2AC3Temp.aac" | aften -v 1 -b 640 \
-raw_fmt s24_le -raw_sr $RATE -raw_ch $CHANNELS -chmap 2 - "$WORKDIR/AAC2AC3Temp.ac3"

# make things pretty
echo "**********"
echo

# merge everything back together
mkvmerge -o "$OUTPUT" "$INPUT" "$WORKDIR/AAC2AC3Temp.ac3"

# make things pretty
echo

# clean up temp files
rm -f "$WORKDIR/AAC2AC3Temp.mkv"
rm -f "$WORKDIR/AAC2AC3Temp.aac"
rm -f "$WORKDIR/AAC2AC3Temp.ac3"

# all done
exit 0
Firstly,,,, thanks for taking the time to create this script and posting it.

I tried it a couple of times and it does what I want to use it for for the most part.

Firstly, is there a way to stop adding the original aac file and have only the ac3 file in the outputted .mkv file? I tried to figure this out by reading through your script by currently with no luck...

Secondly, the larger issue... but didn't notice this at first is the channel mapping it seems on the 2 different files I have that I tried, the RF is swapped with the Centre Channel.

I was reading on some forums that this is usually caused by converting to wav before converting to ac3 from aac, but not 100% sure if this is actually what's being done.

??

Any idea's I can try?

Thanks in advance.
pisces74ca Wrote:Firstly,,,, thanks for taking the time to create this script and posting it.

I tried it a couple of times and it does what I want to use it for for the most part.

Firstly, is there a way to stop adding the original aac file and have only the ac3 file in the outputted .mkv file? I tried to figure this out by reading through your script by currently with no luck...

Secondly, the larger issue... but didn't notice this at first is the channel mapping it seems on the 2 different files I have that I tried, the RF is swapped with the Centre Channel.

I was reading on some forums that this is usually caused by converting to wav before converting to ac3 from aac, but not 100% sure if this is actually what's being done.

??

Any idea's I can try?

Thanks in advance.

If you give me a day or so I can probably change the script to either keep both audio tracks or just the ac3 track. As for the channel mapping, I'm gonna make a change and let me know if that fixes it. The issue stems like you said from all the conversations happening and each format having a different channel mapping order. Hopefully the change I make will fix it, if not, there's another way to tweak it Smile

Thanks,
Harry
no rush...

But thank-you for replying so quickly...
Here's the updated script. It now asks if you want to append the new AC3 track or if you want to replace all existing audio tracks with the new AC3 track (so in other words, if you tell it to replace, what it does is grab all tracks except audio tracks from the original MKV file and joins that with the new AC3 track).

I've also changed the channel mapping from MPEG layout to WAVE layout, hopefully this will resolve the issue. If not, please let me know.

Thanks,
Harry

Code:
#!/bin/bash
# ----------
# This script takes a MP4 or MKV file with an AAC audio track as input and
#    outputs an MKV file with an AC3 audio track
# ----------
# Needed tools:
# MKVToolnix (install Ubuntu mkvtoolnix package)
# FAAD2 (install Ubuntu faad package)
# Aften (install Ubuntu aften package)
# ----------
# Usage:
# AAC2AC3 Input_File Output_File [Optional_Working_Directory]
# ----------

# initialize variables
INPUT=$1
OUTPUT=$2
WORKDIR=$3

# make things a bit more pretty
echo

# make sure all programs we need are installed
if ! which mkvmerge mkvextract &> /dev/null
then
   echo "MKVToolnix is missing.  Please install the mkvtoolnix package."
   echo
   exit 1
fi
if ! which faad &> /dev/null
then
   echo "FAAD2 is missing.  Please install the faad package."
   echo
   exit 1
fi
if ! which aften &> /dev/null
then
   echo "Aften is missing.  Please install the aften package."
   echo
   exit 1
fi

# make sure passed variables make sense
if [ ! "$INPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "No input file specified."
   echo
   exit 1
fi
if [ ! -f "$INPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "Specified input file doesn't exist."
   echo
   exit 1
fi
if [ ! "$OUTPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "No output file specified."
   echo
   exit 1
fi
if [ -e "$OUTPUT" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "Specified output file already exists."
   echo
   exit 1
fi
if [ ! "$WORKDIR" ]
then
   WORKDIR="`pwd`"
fi
if [ ! -d "$WORKDIR" ]
then
   echo "Usage: AAC2AC3 Input_File Output_File [Optional_Working_Directory]"
   echo
   echo "Specified working directory doesn't exist."
   echo
   exit 1
fi

# check if any temp files are already present
if [ -e "$WORKDIR/AAC2AC3Temp.mkv" ] || [ -e "$WORKDIR/AAC2AC3Temp.aac" ] || \
   [ -e "$WORKDIR/AAC2AC3Temp.ac3" ]
then
   echo "Files AAC2AC3Temp.mkv and/or AAC2AC3Temp.aac and/or AAC2AC3Temp.ac3"
   echo "already exist in the working directory.  These will be overwritten."
   echo
   echo -n "Continue (y/n)?: "
   read CONTINUE
   echo
   if ! ([ "$CONTINUE" == "y" ] || [ "$CONTINUE" == "Y" ])
   then
      echo
      exit 1
   fi
fi

# check if the input file is an MP4 file
if [[ "$INPUT" == *.mp4 ]] || [[ "$INPUT" == *.MP4 ]]
then
   mkvmerge -o "$WORKDIR/AAC2AC3Temp.mkv" "$INPUT"
   INPUT="$WORKDIR/AAC2AC3Temp.mkv"
   echo
   echo "**********"
   echo
fi

# print out details about the file in question
mkvmerge -i "$INPUT"

# ask which track we are converting
echo
echo -n "Please specify track to be converted (look for the (A_AAC) label): "
read TRACK
echo

# check if the track was properly specified
if [ "`expr $TRACK - $TRACK 2> /dev/null`" != "0" ]
then
   echo "Specified track has to be a numeric value."
   echo
   exit 1
fi
if [ $TRACK -lt 1 ]
then
   echo "Specified track can not be less than one."
   echo
   exit 1
fi

# extract the specified track
mkvextract tracks "$INPUT" $TRACK:"$WORKDIR/AAC2AC3Temp.aac"

# make things pretty
echo
echo "**********"
echo

# confirm audio sample rate
echo "Please specify audio track sample rate (press enter for default"
echo -n "of 48000Hz): "
read RATE
echo

# setup default sample rate if needed
if [ ! $RATE ]
then
   RATE=48000
fi

# check if the rate was properly specified
if [ "`expr $RATE - $RATE 2> /dev/null`" != "0" ]
then
   echo "Specified sample rate has to be a numeric value."
   echo
   exit 1
fi
if [ $RATE -lt 1 ]
then
   echo "Specified sample rate can not be less than one."
   echo
   exit 1
fi

# confirm number of audio channels
echo "Please specify the number of channels in audio track (press enter"
echo -n "for default of 6 channels): "
read CHANNELS

# setup default number of channels if needed
if [ ! $CHANNELS ]
then
   CHANNELS=6
fi

# check if the rate was properly specified
if [ "`expr $CHANNELS - $CHANNELS 2> /dev/null`" != "0" ]
then
   echo
   echo "Specified number of channels has to be a numeric value."
   echo
   exit 1
fi
if [ $CHANNELS -lt 1 ]
then
   echo
   echo "Specified number of channels can not be less than one."
   echo
   exit 1
fi

# faad outputs a raw 24 bit PCM stream (anything higher than 24 bits seems to
# introduce anomalies) which is then piped to aften and converted to a 640 kbit/s
# AC3 stream (640 kbit/s is max allowed and yields highest possible quality)
faad -b 2 -f 2 -q -w "$WORKDIR/AAC2AC3Temp.aac" | aften -v 1 -b 640 \
-raw_fmt s24_le -raw_sr $RATE -raw_ch $CHANNELS -chmap 0 - "$WORKDIR/AAC2AC3Temp.ac3"

# make things pretty
echo "**********"
echo

# check if we are appending the ac3 track or replacing any existing audio tracks
# with the new ac3 track
echo "The AC3 audio track can be appended (resulting MKV file will contain"
echo "the existing audio tracks plus the new ac3 audio track) or the AC3 audio"
echo "track can replace all existing audio tracks (resulting MKV file will"
echo "contain only the AC3 audio track)."
echo
echo -n "Append or replace (press enter for default of append) (a/r): "
read APPENDREPLACE
echo

# setup default append/replace if needed
if [ ! $APPENDREPLACE ]
then
   APPENDREPLACE="a"
fi

# do different things depending on what was specified
if [ "$APPENDREPLACE" == "a" ] || [ "$APPENDREPLACE" == "A" ]
then
   # merge everything back together
   mkvmerge -o "$OUTPUT" "$INPUT" "$WORKDIR/AAC2AC3Temp.ac3"
elif [ "$APPENDREPLACE" == "r" ] || [ "$APPENDREPLACE" == "R" ]
then
   # merge everything back together (except audio tracks from original file)
   mkvmerge -o "$OUTPUT" -A "$INPUT" "$WORKDIR/AAC2AC3Temp.ac3"
else
   # neither append nor replace was specified
   echo "Neither append nor replace was specified."
   echo
   exit 1
fi

# make things pretty
echo

# clean up temp files
rm -f "$WORKDIR/AAC2AC3Temp.mkv"
rm -f "$WORKDIR/AAC2AC3Temp.aac"
rm -f "$WORKDIR/AAC2AC3Temp.ac3"

# all done
exit 0
Wow... already!!

Thanks I'll try it now and let you know soon the results...

Smile
Thanks very much...!!

Just checked @ home...

Channels sound like they are mapped correctly on the 2 files I tried (Sound Great!), also the change you made to append OR remove the .aac track works perfectly.

I only altered the 640kbps ac3 option in the script to 384kps so the file is a tiny bit smaller as I have as of yet to discern the difference in quality with my yamaha rxv-861 receiver.

--------------

Now I only need to auto convert to .m2ts so the movie is compatible on both the WDTV Live TV & my PS3... sweet!

Smile
Also, I am sure more people will have interest in your script soon (very cool).

As like my situation in having both a PS3 and WD TV Live they will notice soon that unless they have a receiver that can decode the .mp4; .aac audio track natively via HDMI and not have the PS3 convert everything to 5.1 or 7.1 MPCM they will also convert back to using ac3 audio.

Really would just be easier if the PS3 could read .mkv files and save all the headaches.

Thanks again...
pisces74ca Wrote:Also, I am sure more people will have interest in your script soon (very cool).

As like my situation in having both a PS3 and WD TV Live they will notice soon that unless they have a receiver that can decode the .mp4; .aac audio track natively via HDMI and not have the PS3 convert everything to 5.1 or 7.1 MPCM they will also convert back to using ac3 audio.

Really would just be easier if the PS3 could read .mkv files and save all the headaches.

Thanks again...

Thanks. Glad to know it's helpful. Also thanks for checking the channel mapping, always good to have more feedback than just my own Smile

Harry
Hi.

I had a problem with your script. System is debian lenny.

While converting from aac to ac3, i got:

input format: RAW Signed 24-bit little-endian 48000 Hz 6-channel
6-channel audio must have LFE channel
error initializing encoder

and that led to:

mkvmerge v2.4.1 ('Use Me') built on Dec 13 2008 21:03:46
Error: The source file '/home/jure/banlieue/AAC2AC3Temp.ac3' could not be opened successfully, or retrieving its size by seeking to the end did not work.

Tried with all 3 mp4 files I have, same result. Solution was to add parameter -lfe 1 to aften, that tells him that I do have LFE channel:

faad -b 2 -f 2 -q -w "$WORKDIR/AAC2AC3Temp.aac" | aften -v 1 \
-raw_fmt s24_le -raw_sr $RATE -raw_ch $CHANNELS -lfe 1 -chmap 0 - "$WORKDIR/AAC2AC3Temp.ac3"
hrabri Wrote:Hi.

I had a problem with your script. System is debian lenny.

While converting from aac to ac3, i got:

input format: RAW Signed 24-bit little-endian 48000 Hz 6-channel
6-channel audio must have LFE channel
error initializing encoder

and that led to:

mkvmerge v2.4.1 ('Use Me') built on Dec 13 2008 21:03:46
Error: The source file '/home/jure/banlieue/AAC2AC3Temp.ac3' could not be opened successfully, or retrieving its size by seeking to the end did not work.

Tried with all 3 mp4 files I have, same result. Solution was to add parameter -lfe 1 to aften, that tells him that I do have LFE channel:

faad -b 2 -f 2 -q -w "$WORKDIR/AAC2AC3Temp.aac" | aften -v 1 \
-raw_fmt s24_le -raw_sr $RATE -raw_ch $CHANNELS -lfe 1 -chmap 0 - "$WORKDIR/AAC2AC3Temp.ac3"

Interesting, thanks for the heads up on how you fixed it. If more people report this issue I'll implement something in the script, but it looks like maybe it was just the original files that were encoded incorrectly ... or maybe not Smile

Thanks,
Harry
Harry,

Thanks for the script. I was looking at trying to figure out how to do this.

For archival purposes, faad -b 2 hangs on my system (64 bit ubuntu Karmic). Changing to -b 1 works. To work with that, I had to change to aften -raw_fmt s16_le.

Otherwise, I made some edits to make it less interactive, and it's exactly what I was going to write for myself.
Thank you so much for the script. I was so annoyed when I found out that I had quite a few files that wouldn't produce any audio. Thanks to your script it looks like I'll be able to play those files properly after all !
Pages: 1 2