[FFmpeg-devel] [PATCH] support for ordered chapters/segment linking in Matroska

Michael Niedermayer michaelni
Wed Aug 13 01:26:17 CEST 2008


On Wed, Aug 13, 2008 at 12:17:50AM +0200, John B wrote:
> Sorry for the spam, but I took a look at the appropriate places and I
> think this *might* be possible, and also give ffmpeg a nice feature
> (concatenation of Vorbis streams) in the process.
> 
> Vorbis has 3 header packets for setup. The first one has a few
> critical values that must match (samplerate, channels and both
> blocksizes [window sizes] - incidentally, mkvmerge doesn't check
> blocksizes). The 2nd header is metadata and isn't needed for decoding.
> 
> The third is the setup header and is where things turn interesting -
> it includes a number of (VLC) codebooks, (spectral) floors, residues,
> (channel) mappings and finally modes. A mode references a block size
> and a mapping, which references floors and residues, which reference
> codeblocks.
> 
> Every audio packet has a single bit header (a 0) followed as few bits
> as possible [ilog(modes)] to select a mode number for decoding, and
> then comes the actual packet data.
> 
> The idea here is that you can theoretically build a codec setup header
> that contains all setups from all the concatenated segments. This
> would increase the size of every individual audio packet an average of
> log2(n) bits, where n is the total number of setups you're merging.
> You'd have to modify the audio packets to point to the correct setup.
> A more refined implementation would try to re-use matching modes
> whenever possible.

insanity ...

If you want to concatenate use a codec that supports it, mp3, ac3 and aac
likely do. vorbis does not unless all 3 headers match exactly.


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080813/27ff30b1/attachment.pgp>



More information about the ffmpeg-devel mailing list