6

All of the current FLAC streaming implementations (such as Edcast with Icecast) seem to use Ogg as a container for FLAC while streaming.

  1. What is the reason for this?
  2. What are the drawbacks of not using Ogg, and streaming the "native" FLAC stream instead?

I've done some tests streaming FLAC over HTTP, and it seems to work just fine in VLC. FLAC seems to be built in such a way that frames can stand independently, making it robust against stream corruption and/or dropped frames. Given this, I don't quite understand why wrapping FLAC in Ogg is necessary.

blahdiblah
  • 33,069
  • 21
  • 98
  • 152
Brad
  • 159,648
  • 54
  • 349
  • 530
  • And neither "stream corruption and/or dropped frames" should happen with HTTP. – Dan D. Jul 15 '12 at 05:29
  • 1
    @DanD., This happens often on the encoding end, when an encoder is stopped and restarted while clients are connected. I wasn't referring to the network layer, sorry for being unclear. In addition, on the server end, it seems to allow for a "dumb" implementation where the server sends some initialization data and then drops right into the stream at an arbitrary point. I have yet to test that aspect though. – Brad Jul 15 '12 at 14:15
  • 2
    I live in Chicago! Yummm, cupcakes! /me knows what I'll be researching tonight! – Mahmoud Al-Qudsi Jul 20 '12 at 02:52

1 Answers1

6

The FLAC-to-Ogg mapping page has a fairly thorough explanation of why it's desirable to use Ogg encapsulation in many cases instead of streaming native FLAC:

The original FLAC format includes a very thin transport system ... known as 'native FLAC'. ... It is very lightweight and does not support more elaborate transport mechanisms such as multiple logical streams, ...

The native FLAC transport is not a transport "layer" in the way of standard codec design because it cannot be entirely separated from the payload. ...

This presents a problem when trying to encapsulate FLAC in other true transport layers ...

The alternative is to treat native FLAC frames as Ogg packets and accept the transport redundancy. It turns out that this is not much of a penalty; ... The redundancy amounts to a fraction of a percent.

[emphasis added]

See the complete page for more information, but the upshot is that while usable for streaming, native FLAC isn't well-suited to more complex setups and the cost of Ogg encapsulation is quite low. If native FLAC works fine for your specific needs, you can go ahead and use it, but Ogg will ultimately give you more flexibility.

Community
  • 1
  • 1
blahdiblah
  • 33,069
  • 21
  • 98
  • 152
  • Thanks, I've seen this explanation, but most of it doesn't apply to streaming a single stream. For just a simple single stream, I don't see the benefit. In any case, thank you for this explanation. Assuming that I only need the single stream at a time, is there anything else I am not considering? – Brad Jul 21 '12 at 03:20
  • If nothing else, given the preference of streaming software to do Ogg encapsulation, there's probably more *playback* software out there compatible with Ogg instead of native FLAC, but that might not matter for your case. If you're just streaming single streams to VLC, I don't see any special benefit to encapsulating. – blahdiblah Jul 21 '12 at 21:20