View Full Version : How to transcode aac file to mp3 file using encoder?
stax76
13th September 2008, 14:01
All tutorials I've found deal with video files making me wonder if mencoder can work with audio files only. How would I transcode a aac file to a mp3 file?
nm
13th September 2008, 15:59
Try this hack: TOOLS/aconvert.sh (http://svn.mplayerhq.hu/mplayer/trunk/TOOLS/aconvert.sh?content-type=text%2Fplain&view=co)
stax76
13th September 2008, 16:47
I was hoping for a simple windows solution, maybe ffmpeg does a better job.
nm
13th September 2008, 18:18
This might not be the best place to ask for Windows solutions :)
Anyway, the script is quite simple and I'm pretty sure that it could be modified to work on the Windows command line too. Here's the main command for MP3 encoding:mencoder -demuxer rawvideo -rawvideo w=1:h=1 -ovc copy -oac mp3lame -of rawaudio -audiofile INPUT -o OUTPUT INPUT
Note that the input file is given two times, both as audio (-audiofile INPUT) and as raw video (-demuxer rawvideo -rawvideo w=1:h=1 INPUT). MEncoder will ignore the video stream because of the specified 1x1 resolution (it is a hack). Only a raw audio stream is written to the output file (-of rawaudio).
The only practical problem with this command is that the encoding will go on for a long time unless you tell MEncoder to stop it at the end of the audio input by specifying "-endpos INPUT_DURATION_IN_SECONDS". This duration can be found out with "mplayer -identify", as is done in aconvert.sh:mplayer -identify INPUT -frames 0 2>&1 | grep ID_LENGTH | cut -d "=" -f 2You can either come up with a Windows script/program to do this or specify the duration manually. Or simply use something like -endpos X, where X is larger than any expected input duration (for example, 36000 seconds = 10 hours).
But yes, ffmpeg handles audio-only encoding better.
Selur
15th September 2008, 18:27
Note that the input file is given two times, both as audio (-audiofile INPUT) and as raw video (-demuxer rawvideo -rawvideo w=1:h=1 INPUT). MEncoder will ignore the video stream because of the specified 1x1 resolution (it is a hack). Only a raw audio stream is written to the output file (-of rawaudio).
cool didn't know this 'hack' thanks for the info :)
really prefer mencoder audio handling since it can do an way better downsampling than ffmpeg. ;)
buzzqw
16th September 2008, 08:40
great hint! thanks nm!
BHH
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.