View Full Version : Converting to AAC
Lele-brz
20th June 2008, 14:49
Hi,
I'm trying to find a good way to convert a audio track inside a video (all possible formats) into AAC.
I've always used FFmpeg with the following command line
-y -i input.ext -ab 64 -ar 22050 -ac 2 -acodec aac output.aac
and it's ok, but there are some video track that ffmpeg can't read.
What else can I use?
thanks in advance
Lele-brz
24th June 2008, 15:21
Is it possible to use faac.exe or neroAacEnc.exe piping the audio from mplayer or mencoder?
I tried with
mplayer -vo null -ao pcm c:\output.mp4 | faac.exe -b 64 -o output.aac -
But I got:
Couldn't open input file -
Any idea?
Thanks
fibbingbear
25th June 2008, 02:27
If that works for the majority of your files, then use that. For the remainder, maybe you can get an mp4 demuxer and extract the audio stream. From there it should be easier to convert the sound to WAVE or MP3/AAC/whatever format.
Lele-brz
25th June 2008, 08:32
Hi,
thanks for replying.
No, the command line I put doesn't work, there must be something wrong and that's why I'm asking here.
What I would like to do is to use mplayer/mencoder as a demultiplexer to get the raw audio and encode it piping to faac or neroAacEnc.
I know about wavi but I would like to depend on mplayer/mencoder as a source splitter.
So, is it possible?
Thanks again
Bye
tebasuna51
25th June 2008, 09:32
mplayer isn't recommended like multichannel audio decoder because bugs in channelmapping.
Gusar
25th June 2008, 09:45
To use mplayer, you need a fifo on the filesystem. No idea if Windows supports that. On Linux, this would look like this:mkfifo audiodump.wav
neroAacEnc -ignorelength -q 0.25 -if audiodump.wav -of audio.mp4 & mplayer -really-quiet -ao pcm:fast audio1.ac3
@Tebasuna: MPlayer has had channel reordering for quite some time now. The above command will work even with multichannel audio just by adding "-channels 6" to the mplayer command. There might be bugs with "-ao dsound" (needed for multichannel playback on Windows), but "-ao pcm" should work. It does in Linux at least.
Lele-brz
25th June 2008, 10:04
Thanks, unfortunately I have to do that under Windows.
Maybe with mencoder is possible to encode only the audio track in aac?
Gusar
25th June 2008, 13:34
Lets see, this should work:mencoder somefile.avi -ovc copy -oac faac -faacopts quality=60 -of rawaudio -o audio.aacFor bitrate based encoding, use br= instead of quality=
tebasuna51
25th June 2008, 15:30
Lets see, this should work:mencoder somefile.avi -ovc copy -oac faac -faacopts quality=60 -of rawaudio -o audio.aacFor bitrate based encoding, use br= instead of quality=
Seems works with stereo audio.
Is possible preserve multichannel audio instead the automatic dowmix?
Lele-brz
25th June 2008, 16:09
thanks, it works even for me.
The problem is that the bitrate doesn't seem to be precise.
mencoder c:\reno.wmv -ovc copy -oac faac -faacopts br=64 -of rawaudio -channels 2 -o audio.aac
But the resulting aac was at 94 kbps
Dark Shikari
25th June 2008, 16:14
Thanks, unfortunately I have to do that under Windows.Use Cygwin, it supports fifos.
Lele-brz
25th June 2008, 16:46
well, for what I have to do unfortunately I cannot use cygwin.
I noticed that MediaCoder does something like that on windows.
But I guess it uses a mechanism to create pipe with some windows API....
Gusar
25th June 2008, 17:37
Seems works with stereo audio.
Is possible preserve multichannel audio instead the automatic dowmix?Yes, just add "-channels 6"
tebasuna51
25th June 2008, 18:47
Yes, just add "-channels 6"
Thanks.
With MEncoder dev-SVN-r23107-4.3.0 (meGUI) the channelmapping problem still present.
Gusar
25th June 2008, 21:01
Your build is old, more than a year old, mplayer is at 27136 now. I've no idea when channel reordering was added, but my feeling tells me it was this year. So, try with a more recent build.
EDIT: Found it, reordering was added in December 2007, revision 25343, click (http://article.gmane.org/gmane.comp.video.mplayer.cvs/7805/match=channel+reordering). Dsound is not on that list, so playback on Windows might still be screwed, but re-encoding should work.
tebasuna51
26th June 2008, 00:46
Your build is old, more than a year old, mplayer is at 27136 now. I've no idea when channel reordering was added, but my feeling tells me it was this year. So, try with a more recent build.
I can't found more recent binaries. The mencoder in oficial web (www.mplayerhq.hu) is older (1.0rc2-4.2.1) than the megui.
Gusar
26th June 2008, 08:41
Not quite up to date either, but at least it's from April of this year: the CCCP build (http://www.cccp-project.net/smf/index.php?PHPSESSID=6a90d7b17ad576a32e52616176ffaf08&topic=811.0).
As for dsound, when multichannel support was added to it, a hack was put in that gives correct channel mapping for AC3. So multichannel playback works correctly for AC3 but for nothing else. What one would need to do is remove that hack and hook ao_dsound to the reordering function, similar to how ao_pcm was. It shouldn't be very hard to do for anyone with at least a little bit of coding experience (unfortunately, that's not me).
Selur
8th August 2008, 15:53
Hoping this is a good thread to attach my problem (thinking that this is the same as mentioned in the thread).
using MEncoder Sherpya-SVN-r27323-4.2.4 and this command line:
mencoder -mc 0 -noskip "test.avi" -ovc copy -oac faac -faacopts br=64:mpeg=4:object=2 -af volume=5 -channels 2 -srate 48000 -of rawaudio -o "test.aac"
and changing the samplerate (srate) I get the following bitrates for the output:
srate->bitrate
48000 -> 128kBit/s+
32000 -> 96kBit/s+
24000 -> 76kBit/s+
22000 -> 72kBit/s+
22500 -> 72kBit/s+
20000 -> 66kBit/s+
19000 -> 64kBit/s+
16000 -> 62kBit/s+
12000 -> 64kBit/s+
8000 -> 56kBit/s+
Can someone explain this and is there some documentation about this, e.g. like how low do I need to set the samplingrate Y to archive bitrate X ?
Cu Selur
Sharktooth
8th August 2008, 16:11
@tebasuna51:try oss.netfarm.it <- sherpya.
the mplayer package contains mencoder too.
Selur
8th August 2008, 19:27
if you have problems connecting to oss.netfarm.it (had some issues some month ago), the downloads link to: http://sourceforge.net/projects/mplayer-win32/ ;)
gongloo
2nd November 2009, 07:45
Hoping this is a good thread to attach my problem (thinking that this is the same as mentioned in the thread).
using MEncoder Sherpya-SVN-r27323-4.2.4 and this command line:
mencoder -mc 0 -noskip "test.avi" -ovc copy -oac faac -faacopts br=64:mpeg=4:object=2 -af volume=5 -channels 2 -srate 48000 -of rawaudio -o "test.aac"
and changing the samplerate (srate) I get the following bitrates for the output:
srate->bitrate
48000 -> 128kBit/s+
32000 -> 96kBit/s+
24000 -> 76kBit/s+
22000 -> 72kBit/s+
22500 -> 72kBit/s+
20000 -> 66kBit/s+
19000 -> 64kBit/s+
16000 -> 62kBit/s+
12000 -> 64kBit/s+
8000 -> 56kBit/s+
Can someone explain this and is there some documentation about this, e.g. like how low do I need to set the samplingrate Y to archive bitrate X ?
Cu Selur
I'm getting similar behavior (namely, higher bitrate than requested) out of faad2 via mencoder as well. Anyone have any ideas? For now, I've been using low values for q= instead, which at least gets me closer to my desired bitrate.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.