FDK-AAC-DABplus
This is open-source version of DAB+ encoder. fdk-aac-dabplus reads audio data from standard input, and outputs data on standard output. The second tool fdk-aac-dabplus-zmq outputs frames using ZeroMQ, which can be used with the inputZmq from CRC-DabMux
Contents |
Installation
Prerequisites
fdk-aac-dabplus depends on libfec.
fdk-aac-dabplus-zmq depends on libfec and ZeroMQ.
For instructions on how to install these, please see CRC-DabMux#Prerequisites
Building
git clone https://github.com/mpbraendli/fdk-aac-dabplus.git cd fdk-aac-dabplus ./bootstrap ./configure --enable-example --enable-zmq make sudo make install
Remove the flag --enable-zmq if you don't want to compile fdk-aac-dabplus-zmq
If the bootstrap step fails, you can try
autoreconf -i
instead.
Usage
Encoding
After successful installation, it can be used to encode DAB+ in several ways.
Encoding of audio input, output to fifo:
ALSASRC="default" BITRATE=64 sox -t alsa $ALSASRC -b 16 -t raw - rate 48k channels 2 | \ ../fdk-aac-dabplus/aac-enc-dabplus \ -i /dev/stdin -b $BITRATE -f raw -a -o -o /dev/stdout 2>/dev/null | \ mbuffer -q -m 10k -P 100 -s 360 > station1.fifo
Encoding of audio input, output to crc-dabmux using ZeroMQ
ALSASRC="default" BITRATE=64 DST="tcp://your.dabmux.example.com:9000" sox -t alsa $ALSASRC -b 16 -t raw - rate 48k channels 2 | \ ../fdk-aac-dabplus/aac-enc-dabplus-zmq \ -i /dev/stdin -b $BITRATE -f raw -a -o $DST
Live Stream enconding and preparing for DAB mux:
arecord -t raw -f S16_LE -c 2 -r 48000 -D plughw:CARD=Loopback,DEV=0,SUBDEV=0 | \ aac-enc-dabplus -b 24 -f raw -c 2 -r 48000 -i /dev/stdin -o /dev/stdout 2>/dev/null | \ mbuffer -q -m 10k -P 100 -s 360 > station1.fifo
Wave file enconding and preparing for crc-dabmux:
aac-enc-dabplus -a -b 64 -i wave_file.wav -o station1.dabp
Also have a look at the encode- scripts available in the [mmbtools-aux repository]
Problem solving
If you are using a pipe between the encoder and crc-dabmux, and you see a lot of errors like this:
<2> ERROR: Incomplete DAB+ frame! 136 != 360 <5> reach end of file -> rewinding <2> ERROR: Can't rewind file <6> ETI frame number: 228
Then the stream has to be buffered before giving it to muxer, this additional buffer installed between encoder and fifo. To calculate proper block size for mbuffer ("-s" parameter), the table below may be used:
DAB+ Stream bitrate, kbps | Block size, bytes |
---|---|
16 | 240 |
24 | 360 |
32 | 480 |
48 | 720 |
56 | 840 |
64 | 960 |
72 | 1080 |
128 | 1920 |
160 | 2400 |
In example above, for stream with bitrate 24 kbps, mbuffer size set to 360 bytes. This trick helping to solve problem.
In the case you are using ZeroMQ between the encoder and crc-dabmux, and you see errors that the size of the data is wrong, then the configured bitrate in the mux probably doesn't correspond to the bitrate given to the encoder. Make sure they are identical.