[Vorbis-dev] ogg_stream_flush
Michael Smith
msmith at xiph.org
Tue Feb 21 02:33:39 PST 2006
On 2/21/06, Joost Pennings <joostpen at zonnet.nl> wrote:
> Hi,
>
> While building an ogg-vorbis stream encoder, I encountered some problems
> with silence in the audiostream.
>
> The bitrate drops to almost zero, and pages going out less then ones a
> minute what makes the stream to stop / buffer.
>
> In earlier postings I read that I shout use ogg_stream_flush as an
> alternative to ogg_stream_pageout, in case of silence.
>
> My question is this; Is there any reason for not using ogg_stream_flush all
> the time.
>
> So what are the advantages of ogg_stream_pageout?
It's a very bad idea to always use ogg_stream_flush - that will mean
you're outputting a full ogg page for every vorbis packet. The bitrate
overhead for doing this will be quite large on normal input.
Generally, you want to issue a flush if you haven't output a page with
more than (some threshold) seconds of data - commonly, you might use
half a second, or one second.
Mike
More information about the Vorbis-dev
mailing list