Hi all, I'm getting mired in conflicting and dated information, so I think I need to ask this of live humans... :-) I'm essentially trying to create an Ogg file that works like DVD video does. In particular, in addition to the Theora video stream, there will be multiple audio "tracks" (By "track", I mean a collection of channels to be played all at once, but only one track should be played at a time). Each track may have a number of channels, e.g.: 1 for mono, 2 for stereo, 6 for 5.1 surround sound. The tracks can be FLAC or Vorbis or a mixture of the two. So, for example, I might have: Track 1 - English 5.1 Surround (6 channels) Track 2 - English Stereo (2 channels) Track 3 - French Mono (1 channel) Track 4 - Spanish Stereo (2 channels) I have just (finally!) found 5.1 channel assignments for FLAC and Vorbis, and wouldn't-you-know, they disagree: Vorbis FLAC L L R R LS LFE RS LS LFE RS Fortunately, stereo and mono seem to be fairly tame. The tracks can be FLAC or Vorbis or a mixture of the two. Anybody know what the state of the art is now? 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? Do players actually support this? And What tools exist to merge separate single-channel FLAC files into a multichannel FLAC? I already know of the ogg-tools and oggz-tools utilities for manipulating the Ogg streams, so I think I have that part covered. Thanks! Terry
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
On Fri, Mar 11, 2011 at 3:31 PM, Terry Hancock <digitante at gmail.com> wrote:> I'm essentially trying to create an Ogg file that works like DVD video does. > [...] > > What tools exist to merge separate single-channel FLAC files into a > multichannel FLAC?Okay, I actually figured out how to do this more or less on my own, so let me summarize. I was expecting to need a command line utility, but Audacity, it turns out, has the ability to remap channels as of version 1.3.3. It's necessary to set (v1.3.12): Edit -> Preferences... -> Import/Export -> Use Custom MIx * Import each FLAC file into a track. * Label in some way you can recognize * Export * Choose FLAC output * Map the tracks (by label) to the correct output channel (The FLAC 5.1 standard being: L, R, C, LFE, LS, RS) This creates a .FLAC contain the 5.1 surround sound. Then use the 'flac' command line utility to convert to Ogg FLAC: $ flac my_51_MUX.flac --ogg -o my_51_MUX.oga Then use the 'oggz-merge' utility to combine the track with video. Can also do extra tracks: $ oggz-merge my_Theora_video.ogv my_51_MUX.flac my_STEREO.flac my_SP_STEREO.flac [...] -o my_combined_video_file.ogv Playback tests fine in VLC. The drop-down audio menu gives track choices by number for each of the tracks, and playback of sound is what I expect. This is with VLC v1.1.3. So far, so good. Thanks, Terry