ac3iec958 (c) 2000 Henrik Theiling henrik@theiling.de
For compilation and installation instructions, read INSTALL.
Description
This program takes an AC3 stream and adds bytes to encode the stream in such a way that is is suitable to be output to a device that transmits 16-bit high byte first signed stereo data on a IEC958 socket. Both consumer format (S/PDIF) and professional format (AES/EBU) should work.
Note that addional to converting the stream with this program, the IEC958 sub-frames should contain the non-audio bit set to 1 and the rate indicator bits set up to indicate the correct rate in order to transmit a compliant stream.
Examples
To play an AC3 stream to the S/PDIF output of your favorite soundcard directly from a VOB file on the DVD, use the following:
> extract_ac3 myfile.vob | ac3iec958 | aplay -f dat -f s16_be
Here, extract_ac3 is from the livid package (www.linuxvideo.org) and aplay from the ALSA package (www.alsa-project.org).
For driving the H+/DXR3 S/PDIF output directly, you may want to swap the byte stream:
> extract_ac3 myfile.vob | ac3iec958 -x > /dev/em8300_ma
To generate a CD track file from DVD VOB files, use the following. Please note that this will be played at the wrong sampling rate by a CD player, since DVD AC3 streams are recorded at 48 kHz, but CDs at 44.1 kHz.
> extract_ac3 myfile.vob | ac3iec958 --cd > track01.cdr
The option --cd makes ac3iec958 align the output to a full 2352 byte boundary as required for CDs (2352 bytes is 1 frame of 75 per second at 44.1 kHz, 16 bit stereo).
Related Work
Obviously, Sébastien Grosland <sgroslan@cybercable.fr> has written a similar program, whose functionality is equal to that of 'ac3iec958 -x'. Unfortunately, I did not know this project existed when writing this program, so I had to rename by own program (Sébastien's is called ac3spdif).
However, my program is more portable (e.g. endian issues) by using configure, it is developed more closely to the standard, and it has more command line switches. :-)
