[flac-dev] Streaming silence with flac

Uli Franke uli.franke at weiss.ch
Tue May 27 11:35:04 PDT 2014


>>> Is there a way to output small blocks/chunks/ogg pages instead
>>> run-length encoding such silent passages into a single page?
> 
>> The official FLAC encoder has an option
>> --disable-constant-subframes, which does exactly that.
> 
> Great. Then I'll take a crawl into the sources... Thanks for this first
> pointer
> 

For the records: The corresponding (not header-exported) function is:

extern FLAC__bool
FLAC__stream_encoder_disable_constant_subframes(FLAC__StreamEncoder
*encoder, FLAC__bool value);

When disabling it during the encoder initialization

  FLAC__stream_encoder_disable_constant_subframes(flac_enc, true);

then even in silent passages the encoder outputs some frames and
icecast2 (or a consumer with similar behaviour) does not complain.

I found some threads on the web in which people had the same problem but
blamed icecast2 for this but weren't aware of the fact that a efficient
encoder can output "no data" in such scenarios ... Perhaps this
correspondence can avoid such problems in the future.

Thanks and regards
Uli

__
source timeout
silence


More information about the flac-dev mailing list