Ticket #136 (closed Feature: fixed)

Opened 2 years ago

Last modified 2 weeks ago

AAC+ support in LiquidSoap

Reported by: Gilou Owned by: toots
Priority: 1 Milestone: NEAR FUTURE
Component: Liquidsoap Version:
Keywords: Cc:
Mac OSX: yes Linux: yes
NetBSD: no Other Operating System: yes
FreeBSD: yes

Description

Hi,

As I said on IRC, there is a library to handle AAC+ (aacplus, HE-AAC) around here:  http://teknoraver.campuslife.it/software/mp4tools/aacplusenc-0.16.3.tar.bz2

How could this be used to have aacp support in liquidsoap? This library/encoder is clearly not free, but we probably can bind it..

Attachments

shout_mime_param_newtypes.patch Download (5.4 KB) - added by toots 20 months ago.
Patch for libshout
ocaml-shout_add_mime.patch Download (1.7 KB) - added by toots 20 months ago.
Patch for ocaml-shout
liquidsoap_add_mime.patch Download (1.1 KB) - added by toots 20 months ago.
Patch for liquidsoap
faac.liq Download (2.9 KB) - added by toots 20 months ago.
output.icecast.faac

Change History

Changed 2 years ago by toots

  • owner changed from admin to toots
  • status changed from new to assigned

I've started looking at this.

For the least I can say, it still needs some work upstream in order to have a usable library..

But the encoding process looks quite ok, and there is a very simple encoding API..

More to come, stay tuned :)

Changed 22 months ago by toots

  • netbsd unset
  • milestone set to NEAR FUTURE

Changed 20 months ago by toots

Patch for libshout

Changed 20 months ago by toots

Patch for ocaml-shout

Changed 20 months ago by toots

Patch for liquidsoap

Changed 20 months ago by toots

output.icecast.faac

Changed 20 months ago by toots

Thanks to the support for external decoders, AAC output should be available soon.

Until then, I have added the required patch for the various software. Here are the instructions:

First is a patch to libshout to add the mime parameter setting:
 * shout_mime_param_newtypes.patch

Then, you a patch to add this parameter in ocaml-shout:
 * ocaml-shout_add_mime.patch

Finally, a patch to add this parameter in liquidsoap:
 * liquidsoap_add_mime.patch

When everything is compiled, you need to setup a custom icecast output using 
an external encoder process, since we don't have AAC encoding for icecast in 
liquidsoap. I have made sucessful tests with aacencplus. The code is in 
faac.liq.

Feel free to adapt the liq code to you need

Things are not fully tested, comments welcome !

Changed 20 months ago by smimram

We should also add some code to support output.icecast.aac via faac (AFIK, there is only file support right now with faac).

Changed 20 months ago by Perarg

Two questions:

1. It is said that aacencplus is used. How can be happened as faac is used. Faac handles only aac streams, not aacplus, right ?

2. Can this applied to Shoutcast Server ?

Is it possible to provide concise instructions on how to setup these patches and have the system work with external codec aacencplus ? (How to patch, what to patch, is there need of re-compilation of everything ?)

Changed 20 months ago by toots

Hi !

I purposedly gave only few indications. So far, this is a work in progress for which I don't want to give support.

I am more seeking for early testers.

The text above is not accurate. I wanted to say that I sucessfully tested it initially with aacencplus. However, at the moment of writing this text, it was only working with faac.

Now, I will try to explain the meaning of this support. There are two things. First, is the support of any kind of stream in libshout, which needs the set of patches for shout, ocaml-shout and liquidsoap. These patches add support for arbitrary mime types for source connections.

Secondly, there is support for AAC, AAC+ or else. As samuel explained in the previous comment, we don't support natively AAC output through icecast in liquidsoap. In order to acheive this, we use the new generic ouput.icecast.external. This operator uses an external program as the audio encoder.

Hence, the second part can be adapted to shoutcast (via protocol=icy) or AAC+, using aacencplus.

But, again, this support is experimental only for now. We are looking for early testers, not production use.

If you want to use it, you should setup an experimental environment and be prepared for digging into issues, and NOT put it in production before you have tested it. In this case, please report issues so that we can fix things :)

Changed 20 months ago by Perarg

Thank you for the detailed post. I understand that this is only for experiment pursposes but i think this is a beginning! I would like to test it in order to see its stability and of-course i will report any issue to improve liquidsoap... But in order to test it, i have to be informed for the installation matters. How can i use these patches, do i have to compile liquid from scratch ?, i have to install firstly faac and aacencplus ?

I may need some instructions steps (like 1,2,3...). Maybe this can be done in private, in order not to fill this post with issues out of subject. (periklis@…)

Thank you ;)

Changed 20 months ago by toots

Hi !

Thanks for your interest. It is great to have testers.

However, I don't think I can provide a step-to-step how-to on how to enable this. It involves many extra steps which depend on your distribution, and I think it is off-topic here.

However, I can summarize the steps you need to do:

  • Install a patched libshout.
  • Patch and compile ocaml-shout against the patched libshout
  • Patch liquidsoap and compile it against the patched ocaml-shout

These three steps are very dependant on the kind of installation you have. If there are things you don't know how to do, I would advise to seek for documentation or ask for help, in particular on channels related to your own distribution. About ocaml-shout and liquidsoap, you can seek for help in our IRC, though we are sometimes doing RL stuff :)

Finally, you need to define a custom output for AAC+ using aacencplus. I would advise you to look at the faac.liq code, as well as the code for output.icecast.{lame,flac} in liquidsoap/scripts/utils.liq[1]. You should need to replace the call to faac, flac or lame by a call to the accencplus, and adapt options depending on the options needed for aacencplus.

Don't hesitate to ask on IRC or the devel mailing lists for more details.

Changed 17 months ago by metamorph68

  • status changed from assigned to closed
  • resolution set to fixed

(In [6521]) Switched to custom implementation of the shout protocols ! New with this:

  • Support for arbitrary headerless formats using content-type and external encoding process
  • Wrappers updated for lame and shoutcast, added custom irc, aim and icq headers for shoutcast. fixes #192
  • Added wrappers for icecast and shoutcast using aacplusenc. fixes #220 and #136
  • Completely rewrote external encoder start/stop mechanisms. Now relies strictly on the encoding process' good behaviour. See (updated) documentation for more details.
  • Added <code>restart_after_delay@ to regulary restart the encoder. Useful for lame and aacplusenc encoders since they tend to fail after some time. Defaults to 3600 seconds for these encoders.

Of course, this might not be bug prone, so feel free to test and report :)

Changed 5 months ago by sim

 decoration Changed 1 year ago by admin

 bathtub Changed 1 year ago by admin

 solar system Changed 1 year ago by admin

 stair parts Changed 1 year ago by admin

 solar supply Changed 1 year ago by admin

Changed 2 weeks ago by metamorph68

(In [6521]) Switched to custom implementation of the shout protocols ! New with this:

  • Support for arbitrary headerless formats using content-type and external encoding process
  • Wrappers updated for lame and shoutcast, added custom irc, aim and icq headers for shoutcast. fixes #192
  • Added wrappers for icecast and shoutcast using aacplusenc. fixes #220 and #136
  • Completely rewrote external encoder start/stop mechanisms. Now relies strictly on the encoding process' good behaviour. See (updated) documentation for more details.
  • Added <code>restart_after_delay@ to regulary restart the encoder. Useful for lame and aacplusenc encoders since they tend to fail after some time. Defaults to 3600 seconds for these encoders.

Of course, this might not be bug prone, so feel free to test and report :)

Changed 2 weeks ago by metamorph68

(In [6521]) Switched to custom implementation of the shout protocols ! New with this:

  • Support for arbitrary headerless formats using content-type and external encoding process
  • Wrappers updated for lame and shoutcast, added custom irc, aim and icq headers for shoutcast. fixes #192
  • Added wrappers for icecast and shoutcast using aacplusenc. fixes #220 and #136
  • Completely rewrote external encoder start/stop mechanisms. Now relies strictly on the encoding process' good behaviour. See (updated) documentation for more details.
  • Added <code>restart_after_delay@ to regulary restart the encoder. Useful for lame and aacplusenc encoders since they tend to fail after some time. Defaults to 3600 seconds for these encoders.

Of course, this might not be bug prone, so feel free to test and report :)

Note: See TracTickets for help on using tickets.