AAC stream not working with moc :(

Another issue thats been giving me the shits is getting AAC streams to play on moc 2.5
ffmpeg is compiled with libfaac and libfaad(v2) support, but moc still says unsupported format! arghh!!
any help?

# ldd libavformat.so
linux-gate.so.1 => (0xffffe000)
libavutil.so.49 => /usr/local/lib/libavutil.so.49 (0xb7f33000)
libavcodec.so.51 => /usr/local/lib/libavcodec.so.51 (0xb7aaa000)
libz.so.1 => /usr/lib/libz.so.1 (0xb7a95000)
libdl.so.2 => /lib/libdl.so.2 (0xb7a91000)
libc.so.6 => /lib/libc.so.6 (0xb794e000)
libm.so.6 => /lib/libm.so.6 (0xb7927000)
libfaac.so.0 => /usr/local/lib/libfaac.so.0 (0xb7915000)
libfaad.so.0 => /usr/local/lib/libfaad.so.0 (0xb78b5000)
/lib/ld-linux.so.2 (0x80000000)

/usr/local/lib/moc/decoder_plugins # ldd libffmpeg_decoder.so
linux-gate.so.1 => (0xffffe000)
libavformat.so.51 => /usr/local/lib/libavformat.so.51 (0xb7ede000)
libavcodec.so.51 => /usr/local/lib/libavcodec.so.51 (0xb7a55000)
libz.so.1 => /usr/lib/libz.so.1 (0xb7a40000)
libfaac.so.0 => /usr/local/lib/libfaac.so.0 (0xb7a2f000)
libfaad.so.0 => /usr/local/lib/libfaad.so.0 (0xb79cf000)
libdl.so.2 => /lib/libdl.so.2 (0xb79cb000)
libavutil.so.49 => /usr/local/lib/libavutil.so.49 (0xb79c0000)
libm.so.6 => /lib/libm.so.6 (0xb7999000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7982000)
libc.so.6 => /lib/libc.so.6 (0xb783f000)
/lib/ld-linux.so.2 (0x80000000)

Jul 7 05:53:26.676907: io_curl.c:342 curl_read_internal(): Doing select()...
Jul 7 05:53:26.677164: server.c:668 server_error(): ERROR: Format not supported
Jul 7 05:53:26.677194: server.c:256 wake_up_server(): Waking up the server
Jul 7 05:53:26.677224: io.c:273 io_close(): Closing stream...

libffmpeg_decoder seems to load ok aswell.

# mocp -T darkdot_theme ~/.moc/test.m3u --debug
Loading plugins from /usr/local/lib/moc/decoder_plugins...
Loading plugin libffmpeg_decoder...
Loading plugin libmp3_decoder...
Running the server...
Trying OSS...

FYI...mime is audio/aac, and header from server looks like this...

Jul 7 05:53:26.472094: io_curl.c:169 debug_callback(): CURL: [RECV HEADER] ICY 200 OK^M
Jul 7 05:53:26.472187: io_curl.c:169 debug_callback(): CURL: [RECV HEADER] icy-notice1:
This stream requires Winamp
Jul 7 05:53:26.472215: io_curl.c:169 debug_callback(): CURL: [RECV HEADER] icy-notice2:SHOUTcast Distributed Network Audio Server/Linux v1.9.7
Jul 7 05:53:26.472246: io_curl.c:342 curl_read_internal(): Doing select()... Jul 7 05:53:26.480831: io_curl.c:169 debug_callback(): CURL: [RECV HEADER] icy-name:S K Y . F M - Classic Rap & Hip Hop - thanks for listening, check us out at www.sky.fm^M Jul 7 05:53:26.480867: io_curl.c:169 debug_callback(): CURL: [RECV HEADER] icy-genre:Rap Hip Hop Urban^M
Jul 7 05:53:26.480892: io_curl.c:169 debug_callback(): CURL: [RECV HEADER] icy-url:http://www.sky.fm/classicrap^M
Jul 7 05:53:26.480918: io_curl.c:169 debug_callback(): CURL: [RECV HEADER] content-type:audio/aac^M
Jul 7 05:53:26.480939: io_curl.c:98 header_callback(): Mime type: 'audio/aac'
Jul 7 05:53:26.480961: io_curl.c:169 debug_callback(): CURL: [RECV HEADER] icy-pub:0^M
Jul 7 05:53:26.480984: io_curl.c:169 debug_callback(): CURL: [RECV HEADER] icy-metaint:32768^M
Jul 7 05:53:26.481014: io_curl.c:134 header_callback(): Icy metadata interval: 32768
Jul 7 05:53:26.481036: io_curl.c:169 debug_callback(): CURL: [RECV HEADER] icy-br:128^M
Jul 7 05:53:26.481069: io_curl.c:169 debug_callback(): CURL: [RECV HEADER] ^M
Jul 7 05:53:26.481104: io_curl.c:61 write_callback(): Got 1176 bytes
Jul 7 05:53:26.481135: io_curl.c:580 io_curl_read(): Read 1176 bytes from the buffer (1176 bytes full)
Jul 7 05:53:26.481155: io_curl.c:342 curl_read_internal(): Doing select()... Jul 7 05:53:26.506876: io_curl.c:61 write_callback(): Got 1408 bytes

i managed to get aac files to play, but streams still doesnt work :(
same error

MOC just doesn't support internet streams decoded by ffmpeg, so aac stream are not supported.

Damian Pietras - MOC developer

dope....just had a look at the ffmpeg.c i can see some of the stream functions are missing in the plugin...no wonder it didnt work ;-)

any chance you will add support ffmpeg streams soon? if i was to code this probly take me little longer :(

It's not that easy for me too. I've looked at it again. The problem is that I don't know how to use ffmpeg when source of data isn't a file. ffplay program distributed with with library has capability to play from internet streams, but I can hear only noise using it. The only program I can see that works is mplayer, but it's insides are complex and sometimes ugly :). If you know any player that does it using ffmpeg it would be easier. Now I'm looking at libfaad2 library, it seems to be easier to use. I will be looking at it when I have free time because I also want to listen to some internet radio stations that use aac.

Damian Pietras - MOC developer

sounds good.

There seem to be few flavours of AAC...
I guess main once we should be interested in is AAC and AAC+ (since most of the AAC streams are done using these two codecs)

more info:

Damian, have you made any progress on this??

fyi: vlc uses liblaad2 too and it can do streamin...might be able to make some sense out of that code...

No progress, I have not much free time for that. VLC code looks better than MPlayer and I think this is the way. Thanks for pointing me at it.

Damian Pietras - MOC developer

Here is my first attempt: ftp://ftp.daper.net/pub/soft/moc/patches/moc-2.5.0-alpha2-aac-stream-support-alpha1.patch

The code is stolen from CMUS :)
tags, duration, bitrate, etc. are not working, but my internet radio works. This patch can be applied to the current SVN version (and probably 2.5.0-alpha2) and you must run autogen.sh after patching the source.

Damian Pietras - MOC developer

Is there any progress on this?

A summary of the discussion on this topic is that the MOC FFmpeg decoder could not play audio from Internet streams... until now.

Yes, I have today committed a patchset (r2873-r2880) which implements this functionality, so go for broke!