roger
2007-Jul-16 12:03 UTC
[Icecast-dev] Writing Alpha Tags into the comments of an ogg stream
> Ideally you'd do it with the program which is encoding our stream. You just > start a new ogg stream when you want to change your metadata and use the > appropriate tags. > > If this is not possible, you can also do this via Icecast. It will insert > the tags for you, creating the new stream. > > Here's what I've managed to turn up quickly as the appropriate syntax. This > really ought to be documented somewhere, but if you can't find anything > either, you may find some source code useful. > > http://lists.xiph.org/pipermail/icecast/2005-March/008962.htmlFigured it out. Using Ices, I can either write to stdin or a file. Using a file method: $ cat metadata artist=Eugene Oregon title=Scanning $ ps -ax |grep ices $ kill -SIGUSR1 [pid of ices] Writing to stdin method: Partial answer is to use Icecast webserver: http://localhost:8000/admin/updatemetadata.xsl?mount=/stream.ogg (One issue I have to remember, I have have permission to write to where ever I'm going to write/put the metadata or having to login with user/pass.) I would imagine using stdin, and as long as I'm on the host, I should be able to do something like: $cat metadata > http://localhost:8000/admin/updatemetadata.xsl?mount=/stream.ogg Probably the best solution for now: My thoughts are to write a ~/.dsctl/metadata and have the *dsctl program output metadata there and the user specify the location of the metadata file. If I can do this without much interruption of streaming with using the kill SIGUSR1, metatags will probably have a change interval of around 1 second. (right?) (*Dsctl is a program used to monitor this device's alpha tags because only analog audio is being piped into the line-in of the sound card.) -- Roger http://www.eskimo.com/~roger/index.html Key fingerprint = 8977 A252 2623 F567 70CD 1261 640F C963 1005 1D61 Mon Jul 16 11:35:13 PDT 2007
Geoff Shang
2007-Jul-20 14:45 UTC
[Icecast-dev] Writing Alpha Tags into the comments of an ogg stream
"roger" <roger@eskimo.com> wrote:> Figured it out. Using Ices, I can either write to stdin or a file. > > > Using a file method: > > $ cat metadata > artist=Eugene Oregon > title=Scanning > > $ ps -ax |grep ices > > $ kill -SIGUSR1 [pid of ices]I *think* you can tell Ices to generate a file containing it's process ID. (it's awhile since I messed with Ices 2.x). If this is true, you could simply do something like: kill -USR1 `cat ices.pid` (assuming USR1 is the right signal, I thought it was USR2 actually but I've not looked.)> Writing to stdin method: > > [snip] > $cat metadata > > http://localhost:8000/admin/updatemetadata.xsl?mount=/stream.oggI'm pretty sure you can't do this. HTTP is a protocol, not a device, so you'd have to pipe to a program which could talk HTTP and turn your standard input into something usable by Icecast. But I'm pretty sure you can send standard output to Ices' standard input and get it to read it too. But I've not ever done this so have not looked at it. Geoff.
Aaron Gutierrez
2007-Jul-20 17:31 UTC
[Icecast-dev] Writing Alpha Tags into the comments of an ogg stream
You should look at the source code for oddcast. it has a neat way of adding metadata to the ogg stream. It uses libogg (which is it using to encode the vorbis stream) and sort of creates a new beginning of stream packet with the new metadata, so that icecast knows to pick up the change. If you aren't using ices to encode the audio, only to send it, I would suggest posting the metadata to icecast directly using either libshout or via an http admin post. unfortunately you are limited by this latter method of setting the Artist and Title metadata. Also, you can definitely save the pid of ices, and send it SIGHUP to reread its configuration data. Aaron On 7/20/07, Geoff Shang <geoff@quitelikely.com> wrote:> > "roger" <roger@eskimo.com> wrote: > > > Figured it out. Using Ices, I can either write to stdin or a file. > > > > > > Using a file method: > > > > $ cat metadata > > artist=Eugene Oregon > > title=Scanning > > > > $ ps -ax |grep ices > > > > $ kill -SIGUSR1 [pid of ices] > > I *think* you can tell Ices to generate a file containing it's process ID. > (it's awhile since I messed with Ices 2.x). > > If this is true, you could simply do something like: > > kill -USR1 `cat ices.pid` > > (assuming USR1 is the right signal, I thought it was USR2 actually but > I've > not looked.) > > > Writing to stdin method: > > > > [snip] > > $cat metadata > > > http://localhost:8000/admin/updatemetadata.xsl?mount=/stream.ogg > > I'm pretty sure you can't do this. HTTP is a protocol, not a device, so > you'd have to pipe to a program which could talk HTTP and turn your > standard > input into something usable by Icecast. > > But I'm pretty sure you can send standard output to Ices' standard input > and > get it to read it too. But I've not ever done this so have not looked at > it. > > Geoff. > > _______________________________________________ > Icecast-dev mailing list > Icecast-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/icecast-dev >-- Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/icecast-dev/attachments/20070720/1b5ad302/attachment.html
roger
2007-Jul-20 18:54 UTC
[Icecast-dev] Writing Alpha Tags into the comments of an ogg stream
On Sat, 2007-07-21 at 00:45 +0300, Geoff Shang wrote:> "roger" <roger@eskimo.com> wrote: > > > Figured it out. Using Ices, I can either write to stdin or a file. > > > > > > Using a file method: > > > > $ cat metadata > > artist=Eugene Oregon > > title=Scanning > > > > $ ps -ax |grep ices > > > > $ kill -SIGUSR1 [pid of ices] > > I *think* you can tell Ices to generate a file containing it's process ID. > (it's awhile since I messed with Ices 2.x). > > If this is true, you could simply do something like: > > kill -USR1 `cat ices.pid` >I thought of this, but figured this would end up to be distro specific where init would create a pid file (ie. Gentoo would create a pid in /var/run). So, I leave this up to the user for now grepping the "$ ps -ax |grep ices" and supplying the pid via an arg. This allows me to work on more pertinent issues (such as only writing a metadata file only when needed instead of every .5 seconds).> (assuming USR1 is the right signal, I thought it was USR2 actually but I've > not looked.)SIGUSR1 according to the Ices2 docs, but I think Icecast uses SIGUSR2.> > Writing to stdin method: > > > > [snip] > > $cat metadata > > > http://localhost:8000/admin/updatemetadata.xsl?mount=/stream.ogg > > I'm pretty sure you can't do this. HTTP is a protocol, not a device, so > you'd have to pipe to a program which could talk HTTP and turn your standard > input into something usable by Icecast. > > But I'm pretty sure you can send standard output to Ices' standard input and > get it to read it too. But I've not ever done this so have not looked at > it. > > Geoff.Trying to keep things portable as usual. Once I figure-out what a good standard method of checking for pid or pid files (ie. /var/run/ices.pid), I'll implement my feature further in my program. Thanks for your time! :-) -- Roger http://www.eskimo.com/~roger/index.html Key fingerprint = 8977 A252 2623 F567 70CD 1261 640F C963 1005 1D61 Fri Jul 20 17:04:09 PDT 2007