[ogg-dev] Removing metadata segmentation

Andrew Taylor andy at benow.ca
Mon Jun 15 10:48:55 PDT 2009


Hello all,

I run the streaming for a community radio station.  We're streaming 
160k/s ogg via icecast.  For an archive mechanism, I have a scheduler 
which starts a pseudo listener and archives to a file, via wget:

wget http://stream/stream.ogg -O "show name.ogg"

That works fine.  The scheduler starts recording 30s before shows start 
and 2m after they end. 

We're also doing scheduled metadata change to indicate the current show 
to listeners.  So for a 4pm show a url is hit which causes icecast to 
change the metadata indicating the 4pm show. That also works fine.

The problem we're seeing is that the metadata change seems to segment 
the ogg file (as recorded via wget).  All the bits are there but the 
index seems to be non-contiguous.  The symptoms of which are that 
seeking in the first 30s (the first metadata segment) with mplayer 
causes mplayer to exit after it exceeds 30s.  If I let mplayer play, it 
will count up to 30s, then the metadata is changed and it counts up to 
the end of the show and plays the next segement (the first 2m of the 
next show).  Other players will only play the first segment.  They see 
the end of the metadata block and exit, even though there might be hours 
left to play in the file. We can't redistribute the recorded oggs as 
we're unsure of how players will handle segements.

Here's a sample of the ogg with metadata segmentation:

http://benow.ca/misc/metadata_segmentation.ogg

What we need is to reset the segmentation and metadata across the whole 
file.  I've tried vorbiscomment to change the metadata, but it only 
affects the first segment.  The only way I've found is to decode and 
reencode via

oggdec -o - metadata_segmentation.ogg | oggenc -o contiguous_metadata.ogg -

but that leads to loss of fidelity due to accumulated error (less 
brightness in audio).

We need a way to unsegment the metadata without re-encoding.  Is there a 
tool out there to do that?  Is there a programmatic way without 
re-encoding frames?

Thanks,

Andy



More information about the ogg-dev mailing list