| 1 |
INTRODUCTION |
| 2 |
============ |
| 3 |
|
| 4 |
poc is a suite of MP3 tools and MP3 streaming programs. It can stream |
| 5 |
MP3s over HTTP, RTP (RFC 2250 and RFC 3119) and a special protocol to |
| 6 |
enable the use of Forward Error Correction to protect the MP3 stream |
| 7 |
against packet loss. It can also stream OGGs over HTTP. |
| 8 |
|
| 9 |
In addition to the streaming programs, poc contains two MP3 tools: |
| 10 |
mp3cue and mp3cut. mp3cue can cut a big MP3 file according to a |
| 11 |
tracklisting contained in a .cue file. mp3cut can split and |
| 12 |
concatenate MP3 files according to time slices given on the command |
| 13 |
line. |
| 14 |
|
| 15 |
INSTALLATION |
| 16 |
============ |
| 17 |
|
| 18 |
All the tools in the poc package can be compiled using GNU make. |
| 19 |
The tools have been tested under MacOSX, Cygwin and Linux. |
| 20 |
|
| 21 |
Edit conf.h, edit Makefile, then use: |
| 22 |
|
| 23 |
make - produce all binaries |
| 24 |
make servers - produce server binaries |
| 25 |
make clients - produce client binaries |
| 26 |
make mp3cue - produce mp3cue binary |
| 27 |
make mp3cut - produce mp3cut binary |
| 28 |
|
| 29 |
STREAMING |
| 30 |
========= |
| 31 |
|
| 32 |
RTP is a protocol used mostly on top of UDP to transfer multimedia data. It |
| 33 |
can be used over multicast (all the UDP servers use a multicast address as |
| 34 |
default). The protocol described in RFC 2250 uses the raw mp3 frames as |
| 35 |
packet payloads, which can lead to problems in case of packet loss, as |
| 36 |
mp3 frames are not independent of one another (the bit reservoir of a |
| 37 |
mp3 frame is stored in previous frames). The protocol described in RFC 3119 |
| 38 |
fixes this problem by using ADUs (independent mp3 frames) as packet payloads, |
| 39 |
but does not protect the stream against packet loss (it does however mitigate |
| 40 |
the effects of packet loss). |
| 41 |
|
| 42 |
poc contains a program which uses a homebrown protocol to protect mp3 |
| 43 |
streams over UDP against packet loss. Like RFC 3119, it uses ADUs, which are |
| 44 |
put together in groups, which are then encoded redundantly using a FEC |
| 45 |
method designed by Luigi Rizzo. |
| 46 |
|
| 47 |
The servers are: |
| 48 |
- poc-http to stream over HTTP |
| 49 |
- pogg-http to stream OGGs over HTTP |
| 50 |
- poc-2250 to stream over RTP RFC 2250 |
| 51 |
- poc-3119 to stream over RTP RFC 3119 |
| 52 |
- poc-fec to stream using FEC |
| 53 |
|
| 54 |
The servers accept a list of MP3 files on the command line and stream them |
| 55 |
sequentially. They can also accept input from stdin using - as a filename. |
| 56 |
|
| 57 |
The clients are: |
| 58 |
- pob-2250 to receive a RTP RFC 2250 stream |
| 59 |
- pob-3119 to receive a RTP RFC 3119 stream |
| 60 |
- pob-fec to receive a FEC protected stream |
| 61 |
|
| 62 |
The clients output the mp3 stream to stdout, so it can be piped into a mp3 |
| 63 |
decoder: |
| 64 |
./pob-3119 | mpg123 - |
| 65 |
with buffering: |
| 66 |
./pob-3119 | mpg123 -b 2048 - |
| 67 |
or it can be sent to a conventional HTTP server: |
| 68 |
./pob-fec | ./poc-http - |
| 69 |
|
| 70 |
MP3 TOOLS |
| 71 |
========= |
| 72 |
|
| 73 |
mp3cue is a tool that can split a big MP3 file according to the |
| 74 |
tracklisting in a .cue file. The command line arguments are very |
| 75 |
simple. To split the big foobar.mp3 file according to foobar.cue: |
| 76 |
|
| 77 |
./mp3cue -c foobar.cue foobar.mp3 |
| 78 |
|
| 79 |
This will produce the following mp3 files: |
| 80 |
|
| 81 |
01. dj bl0rg - goa mix.mp3 |
| 82 |
02. dj m0rf - trance mix.mp3 |
| 83 |
03. dj neingeist - dnb mix.mp3 |
| 84 |
... |
| 85 |
|
| 86 |
mp3cue will split foobar.mp3 in multiple mp3 files according to the |
| 87 |
cue file, and set their id3 tags to the information contained in the |
| 88 |
cue file. mp3cue splits on ADU boundary in order to avoid audio |
| 89 |
glitches and cracks. |
| 90 |
|
| 91 |
|
| 92 |
mp3cut is a command-line tool to split and concatenate mp3 files. The |
| 93 |
splitting is done using ADUs to avoid audio glitches and tracks. To |
| 94 |
extract the first 10 seconds of file foobar.mp3 and write it into |
| 95 |
output.mp3: |
| 96 |
|
| 97 |
./mp3cut -o output.mp3 -t -10:00 foobar.mp3 |
| 98 |
|
| 99 |
To extract the second minute from bla1.mp3 and concatenate the second |
| 100 |
minute of bla2.mp3, and then write the output to output.mp3: |
| 101 |
|
| 102 |
./mp3cut -o output.mp3 -t 01:00-02:00 bla1.mp3 -t 01:00-02:00 bla2.mp3 |
| 103 |
|
| 104 |
NOTE |
| 105 |
==== |
| 106 |
|
| 107 |
poc is a work in progress, it works for me, but is not nearly finished. If |
| 108 |
poc deletes your mp3s, invokes satan or empties your cookie jar, don't hold |
| 109 |
me responsible for it. However, you can mail any suggestions, bug reports |
| 110 |
and fixes to <[email protected]>. |
| 111 |
|
| 112 |
BUILD |
| 113 |
===== |
| 114 |
|
| 115 |
You need a C99 compliant compiler to compile poc. Check conf.h if needed. |
| 116 |
It works under Linux, FreeBSD, MacOSX. |
| 117 |
|
| 118 |
TODO |
| 119 |
==== |
| 120 |
|
| 121 |
Write a real Makefile and check portability. |
| 122 |
Test the programs thoroughly. |
| 123 |
Write input plugins for common audio players (itunes, xmms, winamp). |
| 124 |
Implement feedback into the FEC protocol to allow for autoadaptive FEC. |
| 125 |
Scale the mp3 to reduce FEC overhead. |