[Flac] Audio tracks and channels in OggFLAC

Brian Willoughby brianw at sounds.wa.com
Fri Mar 11 16:08:20 PST 2011


On Mar 11, 2011, at 13:31, Terry Hancock wrote:
> Right now, I'm thinking, the "best practice" is going to be to
> multiplex _channels_ within the audio codec (i.e. FLAC or Vorbis),
> while each _track_ is a separate audio stream in the Ogg file.
>
> Does that make sense?

Yes, I think that's the only sane way to do it.  Besides, FLAC has a  
limit of 8 channels, so if you have one 7.1 surround track then you  
would not be able to add any more channels anyway.  Best to keep the  
tracks separate, but carried in the same stream.


> Do players actually support this?

I seriously doubt it.  You're talking about the cutting edge.  Very  
few players even support surround playback of a single track, much  
less dealing with multiple tracks with multiple channels each.

At this time, there is only one standard.  As you mention, DVD has  
the features that you want, and thus you're not really going to find  
any players that support something other than DVD.  DVD follows the  
MPEG specification for multiplexing multiples independent media  
streams into one single stream.  This is how you get multiple video  
angles and multiple soundtracks.  As far as I know, there is no  
competing standard, thus, if you want to multiplex more than one  
audio (sound)track into a single file/stream, then you're probably  
going to have to use the MPEG stream standard (I forget the precise  
term).

Granted, formats like Ogg support similar features, at least  
theoretically, but I don't think anything out there is compatible.


> And
>
> What tools exist to merge separate single-channel FLAC files into a
> multichannel FLAC?

As far as I know, there are absolutely zero tools for directly  
manipulating FLAC files (other than meta data).  The standard  
procedure with FLAC is to decode the files into some standard  
uncompressed format like AIFF or WAV, and then perform your merging  
on the standard uncompressed data.  Then, once you have the  
multichannel uncompressed master, you would encode the new file into  
FLAC format.

I have been working on a tool to directly split FLAC files that have  
very long sections of pure silence in them (on the order of several  
minutes, not seconds), and I have noticed that the libFLAC API does  
not make this easy.  I have the impression that the intention is not  
to even support direct manipulation of FLAC without an intermediate  
decode and encode.  This actually makes some sense, because the MD5  
error checking stamping must be recalculated for each FLAC file, and  
you need the decoded data to do that anyway.

Brian Willoughby
Sound Consulting



More information about the Flac mailing list