[Vorbis] Re: Help please streaming oggs as they are being created
Andy Baxter
andy at earthsong.free-online.co.uk
Sun Jan 2 06:53:35 PST 2005
On Sun, 24 Oct 2004 12:30:53 -0400, ben-extra wrote:
> Hi all,
>
> I often record radio shows for posterity, and sometimes I have friends
> who would like to listen to them live over the net. When I am
> recording for my own purposes, I use a command of the form: "brec |
> oggenc", (options omitted for clarity) and I send the output to a
> file, call it radio.ogg.
>
> Locally, I use Debian stable. If I want to listen to the show as I
> record it, I can use xmms, the command "xmms radio.ogg" does the
> trick. xmms pops up with the current length of the recording - if it
> is 20 minutes into the show, xmms reports a file length of 20 minutes.
> If I want, I can "seek" into the file, by dragging a control, which
> takes me into the file. When I reach the 20 minute mark, the file
> continues playing, even though the file length continues to be
> indicated as 20 minutes.
>
If all you want is to be able to record to disk and listen to the stream
live at the same time (i.e. the seeking is just to get to the currently
recording part of the file), you could use ices to stream to an icecast
server, and use its file dump feature to save a local copy at the same
time. see www.icecast.org.
This is an ices.xml config file I've been using to stream and record at
two bitrates using the ices-kh branch of ices, which can take its input
from the jack audio daemon. The save file name is filled in with the
current date and time as in the strftime function (man 3 strftime), and a
new file is started whenever the stream metadata is updated (by sending
sig USR1 to ices)
<?xml version="1.0"?>
<ices>
<background>0</background> <!-- run in background? (unimplemented) -->
<logpath>/local/radio/log</logpath> <!-- where logs, etc go. -->
<logfile>ices.log</logfile>
<loglevel>4</loglevel> <!-- 1=error,2=warn,3=info,4=debug -->
<logsize>2048</logsize> <!-- the size the log file must be before rotation -->
<consolelog>0</consolelog> <!-- set this to 1 to log to the console instead
of to the file above -->
<pidfile>/local/radio/run/ices-ogg.pid</pidfile> <!-- file to write process id to -->
<stream>
<!-- input module -->
<input>
<module>jack</module>
<param name="channels">2</param>
<param name="clientname">ices-ogg</param>
<param name="metadatafilename">/local/radio/tmp/ices-metadata</param>
<param name="ignorexrun">1</param>
<param name="connect">ecastream:out_1,ecastream:out_2</param>
</input>
<runner>
<!-- Stream instance -->
<instance>
<shout>
<!-- Server details: -->
<hostname>localhost</hostname>
<port>8000</port>
<password>quarmoor</password>
<mount>/mono.ogg</mount>
<reconnectdelay>2</reconnectdelay>
<reconnectattempts>5</reconnectattempts>
</shout>
<downmix>1</downmix>
<savefile>
<filename>/local/radio/record/icecast-32-m_%d-%b-%Y-%H:%M:%S_.ogg</filename>
<duration>28800</duration> <!-- max 8 hours -->
<on-metadata>1</on-metadata>
</savefile>
<resample>
<out-rate>22050</out-rate>
</resample>
<encode>
<!-- VBR mode can be selected via quality or nominal-bitrate -->
<!-- selecting enabling managed has to be done separately as -->
<!-- it's slower, but can be used to limit a high threshold -->
<!-- <managed>1</managed>
<maximum-bitrate>24000</maximum-bitrate> -->
<nominal-bitrate>19456</nominal-bitrate>
</encode>
</instance>
<instance>
<shout>
<!-- Server details: -->
<hostname>localhost</hostname>
<port>8000</port>
<password>quarmoor</password>
<mount>/stereo.ogg</mount>
<reconnectdelay>2</reconnectdelay>
<reconnectattempts>5</reconnectattempts>
</shout>
<savefile>
<filename>/local/radio/record/icecast-64-s_%d-%b-%Y-%H:%M:%S_.ogg</filename>
<duration>28800</duration> <!-- max 8 hours -->
<on-metadata>1</on-metadata>
</savefile>
<resample>
<out-rate>22050</out-rate>
</resample>
<encode>
<!-- VBR mode can be selected via quality or nominal-bitrate -->
<!-- selecting enabling managed has to be done separately as -->
<!-- it's slower, but can be used to limit a high threshold -->
<!-- <managed>1</managed>
<maximum-bitrate>80000</maximum-bitrate>-->
<nominal-bitrate>65536</nominal-bitrate>
</encode>
</instance>
</runner>
</stream>
</ices>
More information about the Vorbis
mailing list