PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

aac => mp3 using ffmpeg (newbie question)

 
 
petru.marginean@gmail.com
Guest
Posts: n/a
 
      23rd Jul 2006
Hi,

I'm trying to convert a aac file (retrieved from a online radio
station, using fPls) into a mp3 file (to listen to it on my MP3
player).
I've compiled 'mplayer' and 'ffmpeg' (on Windows, using cygwin).
I can do the following basic operations:
1. Listen to the aac file using 'mplayer' (I assume then the aac
decoder is working, right?)
2. Convert a mp3 to another mp3 file using 'ffmpeg' (I assume then
the mp3 coder is working, right?)
3. Convert a mp3 to a aac file
However when trying to:
4. Convert a aac to mp3 file, I get this error:
"Unsupported codec (id=86018) for input stream #0.0"

I pasted below samples for every the above operations. I guess the
answer is in the output these utilities shows, but I cannot decode it
myself.
Any idea what's wrong and what diagnotics/testing I can do more?

Many thanks,
Petru

1. Listen to a aac file is working fine:
-----------------------------------------------------
$> mplayer /tmp/radio/input.aac
MPlayer dev-SVN-r19147-3.4.4 (C) 2000-2006 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (Family: 15, Model:
35, Stepping: 2)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2

Playing /tmp/radio/input.aac.
libavformat file format detected.
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
AUDIO: 44100 Hz, 2 ch, s16le, 35.5 kbit/2.51% (ratio: 4435->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio)
decoder)
==========================================================================
AO: [win32] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 2.7 (02.6) of 1233.4 (20:33.4) 4.1%

2. Converting a mp3 to another mp3 file is also working (128Kb => 64Kb)
---------------------------------------------------------------------------------------------------------
$> ffmpeg -i /tmp/radio/input.mp3 -acodec mp3 -ac 2 -ab 64
/tmp/radio/test.mp3
FFmpeg version SVN-r5804, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mp3lame --enable-faac
libavutil version: 49.0.0
libavcodec version: 51.10.0
libavformat version: 50.5.0
built on Jul 23 2006 02:11:46, gcc: 3.4.4 (cygming special) (gdc
0.12, using dmd 0.125)
Input #0, mp3, from '/tmp/radio/input.mp3':
Duration: 00:02:40.7, start: 0.000000, bitrate: 128 kb/s
Stream #0.0: Audio: mp3, 44100 Hz, stereo, 128 kb/s
File '/tmp/radio/test.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp3, to '/tmp/radio/test.mp3':
Stream #0.0: Audio: mp3, 44100 Hz, stereo, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
size= 1256kB time=160.8 bitrate= 64.0kbits/s
video:0kB audio:1256kB global headers:0kB muxing overhead 0.000000%

3. Convert a mp3 to a aac file is fine
----------------------------------------------
$> ffmpeg -i /tmp/radio/input.mp3 -acodec aac /tmp/radio/output.aac
FFmpeg version SVN-r5804, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mp3lame --enable-faac
libavutil version: 49.0.0
libavcodec version: 51.10.0
libavformat version: 50.5.0
built on Jul 23 2006 02:11:46, gcc: 3.4.4 (cygming special) (gdc
0.12, using dmd 0.125)
Input #0, mp3, from '/tmp/radio/input.mp3':
Duration: 00:02:40.7, start: 0.000000, bitrate: 128 kb/s
Stream #0.0: Audio: mp3, 44100 Hz, stereo, 128 kb/s
Output #0, adts, to '/tmp/radio/output.aac':
Stream #0.0: Audio: aac, 44100 Hz, stereo, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
size= 1255kB time=160.6 bitrate= 64.0kbits/s
video:0kB audio:1255kB global headers:0kB muxing overhead 0.000000%

4. Converting the aac input file to a mp3 file fails!!
------------------------------------------------------------------------
$> ffmpeg -i /tmp/radio/input.aac -acodec mp3 -ac 2 -ab 128
/tmp/radio/test.mp3
FFmpeg version SVN-r5804, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mp3lame --enable-faac
libavutil version: 49.0.0
libavcodec version: 51.10.0
libavformat version: 50.5.0
built on Jul 23 2006 02:11:46, gcc: 3.4.4 (cygming special) (gdc
0.12, using dmd 0.125)
Input #0, aac, from '/tmp/radio/input.aac':
Duration: 00:20:33.4, start: 0.000000, bitrate: 35 kb/s
Stream #0.0: Audio: 0x0000, 22050 Hz, stereo, 35 kb/s
File '/tmp/radio/test.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp3, to '/tmp/radio/test.mp3':
Stream #0.0: Audio: mp3, 22050 Hz, stereo, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Unsupported codec (id=86018) for input stream #0.0

 
Reply With Quote
 
 
 
 
Mark Blain
Guest
Posts: n/a
 
      23rd Jul 2006
(E-Mail Removed) wrote (in part):

> I'm trying to convert a aac file (retrieved from a online radio
> station, using fPls) into a mp3 file (to listen to it on my MP3
> player).
> I've compiled 'mplayer' and 'ffmpeg' (on Windows, using cygwin)...


Mplayer in MS-Windows will use the Windows codecs already
installed in your system. ffmpeg will not. I see that libfaad2
is not listed in your sample output. The following links say
that you must recompile ffmpeg with --enable-faad to include
libfaad2 for aac decoding, and explain how to do that:

<http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2006-April/002746.html>
<http://forum.rivavx.com/viewtopic.php?t=96&view=next&sid=ece5c4b38ae70af86f37da198151ba2b>

I prefer to use "faad 2" for command-line AAC decoding (faac is
an aac encoder, faad is the matching decoder). You can download
a precompiled Win32 binary of faad 2 at
http://rarewares.org/aac.html
For source code or more information about faac and faad, see
http://www.audiocoding.com
http://sourceforge.net/projects/faac
 
Reply With Quote
 
petru.marginean@gmail.com
Guest
Posts: n/a
 
      24th Jul 2006
Thanks for help!
I run in other problems when tryin to compile faad2 library:

1. I've dowloaded faad2 from here:

http://prdownloads.sourceforge.net/f...ar.gz?download

2. Expanded and configured it (got a warning here!!!):
$> tar xvfz faad2-2.0.tar.gz
//..
$> cd faad2
$> ./bootstrap
configure.in:38: warning: underquoted definition of
MY_CHECK_TYPEDEF_FROM_INCLUDE
run info '(automake)Extending aclocal'
or see
http://sources.redhat.com/automake/a...ending-aclocal
configure.in: installing `./install-sh'
configure.in: installing `./missing'
common/mp4ff/Makefile.am: installing `./depcomp'
plugins/xmms/src/Makefile.am: installing `./compile'
Makefile.am: installing `./INSTALL'
Ready to run ./configure
$>./configure
//...

3. Build the lib (got the first error):
$> make
Makefile:624: *** missing separator. Stop.

The line 624 is
//...
632> rpm: Makefile
624> make dist
625> $(RPMBUILD) -ta $(PACKAGE)-$(VERSION).tar.gz
626> rm $(PACKAGE)-$(VERSION).tar.gz
4. I manually removed the whole 'rpm' target above, and tried to 'make'
again, but got an error about "conflicting types for 'lrintf'...

$> make
make all-recursive
make[1]: Entering directory `/usr/src/faad2'
Making all in libfaad
make[2]: Entering directory `/usr/src/faad2/libfaad'
if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
-I. -I.. -g -O2 -MT bits.lo -MD -MP -MF ".deps
/bits.Tpo" -c -o bits.lo bits.c; \
then mv -f ".deps/bits.Tpo" ".deps/bits.Plo"; else rm -f
".deps/bits.Tpo"; exit 1; fi
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT bits.lo -MD -MP -MF
..deps/bits.Tpo -c bits.c -DDLL_EXPORT -DPIC -o .libs/b
its.o
In file included from common.h:347,
from bits.c:28:
/usr/include/math.h:278: error: conflicting types for 'lrintf'
common.h:314: error: previous definition of 'lrintf' was here
make[2]: *** [bits.lo] Error 1
make[2]: Leaving directory `/usr/src/faad2/libfaad'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/faad2'
make: *** [all] Error 2


Now I'm stuck again.
Any idea?

Regards,
Petru





Mark Blain wrote:
> (E-Mail Removed) wrote (in part):
>
> > I'm trying to convert a aac file (retrieved from a online radio
> > station, using fPls) into a mp3 file (to listen to it on my MP3
> > player).
> > I've compiled 'mplayer' and 'ffmpeg' (on Windows, using cygwin)...

>
> Mplayer in MS-Windows will use the Windows codecs already
> installed in your system. ffmpeg will not. I see that libfaad2
> is not listed in your sample output. The following links say
> that you must recompile ffmpeg with --enable-faad to include
> libfaad2 for aac decoding, and explain how to do that:
>
> <http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2006-April/002746.html>
> <http://forum.rivavx.com/viewtopic.php?t=96&view=next&sid=ece5c4b38ae70af86f37da198151ba2b>
>
> I prefer to use "faad 2" for command-line AAC decoding (faac is
> an aac encoder, faad is the matching decoder). You can download
> a precompiled Win32 binary of faad 2 at
> http://rarewares.org/aac.html
> For source code or more information about faac and faad, see
> http://www.audiocoding.com
> http://sourceforge.net/projects/faac


 
Reply With Quote
 
rich
Guest
Posts: n/a
 
      24th Jul 2006
Rich_on 23-Jul-2006, (E-Mail Removed) wrote:

> I'm trying to convert a aac file (retrieved from a online radio
> station, using fPls) into a mp3 file (to listen to it on my MP3
> player).


<snip>

Might not be the way you want to go, however Switch

http://www.nch.com.au/switch/faq.html

will convert .aac format.

--
rich
 
Reply With Quote
 
petru.marginean@gmail.com
Guest
Posts: n/a
 
      24th Jul 2006
Hey,

"Switch" is great: I installed it, and it's working just fine. Thanks
for sharing this info with me.

However I need to do the convertion from the command-line. I plan to
get the online radio station file, convert it and transfer it to my MP3
player using a script (that run overnight).
With Switch (GUI) I will have to click-click-click forever.
For that reason I chose "ffmpeg". But now I'm stuck compiling the faad2
on Cygwin.
Any idea?

Best regards,
Petru

rich wrote:
> Rich_on 23-Jul-2006, (E-Mail Removed) wrote:
>
> > I'm trying to convert a aac file (retrieved from a online radio
> > station, using fPls) into a mp3 file (to listen to it on my MP3
> > player).

>
> <snip>
>
> Might not be the way you want to go, however Switch
>
> http://www.nch.com.au/switch/faq.html
>
> will convert .aac format.
>
> --
> rich


 
Reply With Quote
 
rich
Guest
Posts: n/a
 
      24th Jul 2006
Rich_on 24-Jul-2006, (E-Mail Removed) wrote:

> "Switch" is great: I installed it, and it's working just fine. Thanks
> for sharing this info with me.
>
> However I need to do the convertion from the command-line. I plan to
> get the online radio station file, convert it and transfer it to my MP3
> player using a script (that run overnight).
> With Switch (GUI) I will have to click-click-click forever.
> For that reason I chose "ffmpeg". But now I'm stuck compiling the faad2
> on Cygwin.
> Any idea?

<snipped a bit>

I only once needed to convert a .aac file which was when I found switch.

You say that you are compiling faad - why not use the already compiled faad
from rarewares.org that Mark Blain pointed out.
You would have to go .aac to .wav then use the output and convert to .mp3
I have just been looking at Super(c) from eRightsoft which uses ffmpeg and
will convert much multimedia all ways, but not .aac to .mp3. Perhaps it is
not posible?


--
rich
 
Reply With Quote
 
petru.marginean@gmail.com
Guest
Posts: n/a
 
      24th Jul 2006
Probably I don't know how these things work: I was thinking by
compiling faad2 I would end up with some header files (*.h) and
libraries (*.a) that ffmpeg would use (and it seems it looks for when
configure with the --enable-faad flag)
Please correct me if I'm wrong.

>From the website http://rarewares.org/aac.html I can download the

faad.exe file or the libfaad.dll file. I'm not sure how to use them.

What I want is to be able to configure ffmpeg to use faad:
$> ./configure --enable-faad ...

Best regards,
Petru


rich wrote:
> Rich_on 24-Jul-2006, (E-Mail Removed) wrote:
>
> > "Switch" is great: I installed it, and it's working just fine. Thanks
> > for sharing this info with me.
> >
> > However I need to do the convertion from the command-line. I plan to
> > get the online radio station file, convert it and transfer it to my MP3
> > player using a script (that run overnight).
> > With Switch (GUI) I will have to click-click-click forever.
> > For that reason I chose "ffmpeg". But now I'm stuck compiling the faad2
> > on Cygwin.
> > Any idea?

> <snipped a bit>
>
> I only once needed to convert a .aac file which was when I found switch.
>
> You say that you are compiling faad - why not use the already compiled faad
> from rarewares.org that Mark Blain pointed out.
> You would have to go .aac to .wav then use the output and convert to .mp3
> I have just been looking at Super(c) from eRightsoft which uses ffmpeg and
> will convert much multimedia all ways, but not .aac to .mp3. Perhaps it is
> not posible?
>
>
> --
> rich


 
Reply With Quote
 
petru.marginean@gmail.com
Guest
Posts: n/a
 
      25th Jul 2006
I dowloaded the percompiled faad utility and tried to get the *.wav
from the *.aac file. I get this error:

$> faad -o test.wav KissMusic.aac
*********** Ahead Software MPEG-4 AAC Decoder V2.1 beta
******************
Build: Jul 9 2004
Copyright 2002-2004: Ahead Software AG
http://www.audiocoding.com
Floating point version
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License.

**************************************************************************
KissMusic.aac file info:
RAW
Error: Invalid number of channels

Any idea what's wrong?

Regards,
Petru

rich wrote:
> Rich_on 24-Jul-2006, (E-Mail Removed) wrote:
>
> > "Switch" is great: I installed it, and it's working just fine. Thanks
> > for sharing this info with me.
> >
> > However I need to do the convertion from the command-line. I plan to
> > get the online radio station file, convert it and transfer it to my MP3
> > player using a script (that run overnight).
> > With Switch (GUI) I will have to click-click-click forever.
> > For that reason I chose "ffmpeg". But now I'm stuck compiling the faad2
> > on Cygwin.
> > Any idea?

> <snipped a bit>
>
> I only once needed to convert a .aac file which was when I found switch.
>
> You say that you are compiling faad - why not use the already compiled faad
> from rarewares.org that Mark Blain pointed out.
> You would have to go .aac to .wav then use the output and convert to .mp3
> I have just been looking at Super(c) from eRightsoft which uses ffmpeg and
> will convert much multimedia all ways, but not .aac to .mp3. Perhaps it is
> not posible?
>
>
> --
> rich


 
Reply With Quote
 
petru.marginean@gmail.com
Guest
Posts: n/a
 
      25th Jul 2006
I want to also specify that the input file is playable by both mplayer
and WinAmp.
You can see here the 'Properties' screen from WinAmp for this specific
input file:

http://www.petrum.net/tmp/WinAmp-screen.JPG

Regards,
Petru

petru.margin...@gmail.com wrote:
> I dowloaded the percompiled faad utility and tried to get the *.wav
> from the *.aac file. I get this error:
>
> $> faad -o test.wav KissMusic.aac
> *********** Ahead Software MPEG-4 AAC Decoder V2.1 beta
> ******************
> Build: Jul 9 2004
> Copyright 2002-2004: Ahead Software AG
> http://www.audiocoding.com
> Floating point version
> This program is free software; you can redistribute it and/or modify
> it under the terms of the GNU General Public License.
>
> **************************************************************************
> KissMusic.aac file info:
> RAW
> Error: Invalid number of channels
>
> Any idea what's wrong?
>
> Regards,
> Petru
>
> rich wrote:
> > Rich_on 24-Jul-2006, (E-Mail Removed) wrote:
> >
> > > "Switch" is great: I installed it, and it's working just fine. Thanks
> > > for sharing this info with me.
> > >
> > > However I need to do the convertion from the command-line. I plan to
> > > get the online radio station file, convert it and transfer it to my MP3
> > > player using a script (that run overnight).
> > > With Switch (GUI) I will have to click-click-click forever.
> > > For that reason I chose "ffmpeg". But now I'm stuck compiling the faad2
> > > on Cygwin.
> > > Any idea?

> > <snipped a bit>
> >
> > I only once needed to convert a .aac file which was when I found switch.
> >
> > You say that you are compiling faad - why not use the already compiled faad
> > from rarewares.org that Mark Blain pointed out.
> > You would have to go .aac to .wav then use the output and convert to .mp3
> > I have just been looking at Super(c) from eRightsoft which uses ffmpeg and
> > will convert much multimedia all ways, but not .aac to .mp3. Perhaps it is
> > not posible?
> >
> >
> > --
> > rich


 
Reply With Quote
 
rich
Guest
Posts: n/a
 
      25th Jul 2006
Rich_on 25-Jul-2006, (E-Mail Removed) wrote:

<snip>
> > > > However I need to do the convert ion from the command-line. I plan
> > > >to
> > > > get the online radio station file, convert it and transfer it to my
> > > > MP3
> > > > player using a script (that run overnight).
> > > > With Switch (GUI) I will have to click-click-click forever.
> > > > For that reason I chose "ffmpeg". But now I'm stuck compiling the
> > > > faad2
> > > > on Cygwin.
> > > > Any idea?


> > > <snipped a bit>
> > >
> > > I only once needed to convert a .aac file which was when I found
> > > switch.
> > >
> > > You say that you are compiling faad - why not use the already compiled
> > > faad
> > > from rarewares.org that Mark Blain pointed out.
> > > You would have to go .aac to .wav then use the output and convert to
> > > .mp3
> > > I have just been looking at Super(c) from eRightsoft which uses ffmpeg
> > > and
> > > will convert much multimedia all ways, but not .aac to .mp3. Perhaps
> > > it is
> > > not possible?


<moved a bit to keep the thread>

> I want to also specify that the input file is playable by both mplayer
> and WinAmp.
> You can see here the 'Properties' screen from WinAmp for this specific
> input file:
>
> http://www.petrum.net/tmp/WinAmp-screen.JPG
>



> > I dowloaded the percompiled faad utility and tried to get the *.wav
> > from the *.aac file. I get this error:
> >
> > $> faad -o test.wav KissMusic.aac
> > *********** Ahead Software MPEG-4 AAC Decoder V2.1 beta
> > ******************
> > Build: Jul 9 2004
> > Copyright 2002-2004: Ahead Software AG
> > http://www.audiocoding.com
> > Floating point version
> > This program is free software; you can redistribute it and/or modify
> > it under the terms of the GNU General Public License.
> >
> > **************************************************************************
> > KissMusic.aac file info:
> > RAW
> > Error: Invalid number of channels
> >
> > Any idea what's wrong?


I dont think that I can add much more as I do not normally need to convert
..aac files
however I have tried a few simple tests to see what works and does not.

1. faad
Not having any .aac files I had to make one so I could decode it.
Using belight - a front end for besweet, and the aac conversion option,
there is the first problem - what codec?
There is a faac codec which will make a .aac file which faad will decode.
There is a nero codec which make a .mp4 file which produces the error you
get - RAW - error: invalid number of channels.
I do not know how to fix this problem.

2. Super(c) converter
I mentioned this before because I thought it might convert a .aac file but
didn't.
That was on my new-ish computer which I use for video and graphics.
I installed Super on my old internet box (this one) and for some reason it
will convert the .mp4 file ( the RAW file) but still does not convert the
..aac file.
The point of this is: Super is only a front end for ffmpeg and other things.
By stopping Super half way through a .mp4 to .mp3 conversion I was able to
"rescue" the avisynth script it used.

this is the content of sample.avs
Clip=DirectShowSource("E:\sample.mp4", fps=25, convertfps=true)
ConvertToYV12(Clip)
Subtitle("Me ; )", font="verdana", size=14, text_color=$1afffa,
halo_color=$1f4afa, align=3)

As you see it uses directx in the conversion.
You can use this script as input to ffmpeg bypassing the Superfront end.

ffmpeg -i sample.avs -acodec mp3 test.mp3

Suggestion: Get Super(c) from eRightSoft and see if it will convert your
..aac file, try renaming to .mp4 as .aac is not a valid imput.
If it does, taskkill Super and retrieve the avisynth script from your temp
folder.

Suggestion: Try one of the video forums, possibly doom9.org, they know all
there is to know about ffmpeg. Have a look at avisynth and how it interacts
with ffmpeg.

Suggestion: stop top posting.

Best of luck

--
rich
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not Converted : wmv file to flv using ffmpeg Sham Microsoft C# .NET 0 4th Oct 2008 07:30 AM
FFmpeg Wrapper Rafael tejera Microsoft C# .NET 0 26th Jul 2007 07:44 PM
FFmpeg wrapper Rafael tejera Microsoft ASP .NET 0 26th Jul 2007 07:43 PM
ffmpeg.exe =?Utf-8?B?UmFkYW1lcw==?= Windows XP Video 4 12th Nov 2006 02:54 AM
slow audio file after (ffmpeg) convertion petru.marginean@gmail.com Freeware 2 27th Jul 2006 04:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:28 PM.