[ogg-dev] chaining support

Hans J. Koch hjk at linutronix.de
Tue Jun 30 14:20:37 PDT 2009


On Tue, Jun 30, 2009 at 06:21:04AM +0900, Conrad Parker wrote:
> 2009/6/21 Hans J. Koch <hjk at linutronix.de>:
> > On Sun, Jun 21, 2009 at 01:27:25AM +0900, Conrad Parker wrote:
> >> 2009/6/20 Silvia Pfeiffer <silvia at silvia-pfeiffer.de>:
> >> > I agree, this has been a huge problem - and in fact is a problem with
> >> > html5 <video> more generally than ogg.
> >> >
> >> > How do you think that a chain identifier in skeleton will make it
> >> > possible to have e.g. a single seek bar over a stream? Would it be n
> >> > timelines or one?
> >>
> >> I was thinking that it would be useful to identify sections that are
> >> logically part of the same content.
> >>
> >> eg. if you edit out some part of file A, and end up with the chain A1,
> >> A3. Then after that you play file B, and after that you play some data
> >> derived from file C.
> >>
> >> You might end up with a chain sequence like A1, A3, B, C1, C2, C5.
> >>
> >> Perhaps it would make sense to give a seek bar for (A1, A3), then
> >> reset it for B, and reset it for (C1, C2, C5).
> >>
> >> Does that make sense?
> >>
> >> (Use cases would be useful here...)
> >
> > Is what you have in mind somehow like chapters of a DVD, IOW points in time
> > you yan jump to? That's something I'm looking for. Currently, I'm using OGM
> > containers to store movies with chapters. That's an usecase where I play a
> > movie from disk, but I think it could also be useful for streaming video.
> >
> > Let's say you've got a 50min video of a conference talk. It'd be a nice
> > feature if it had named chapters like 01-introduction, 02-topic1, 03-topic2,
> > ..., 09-conclusion. I watch the introduction, skip forward to chapter 3
> > because I'm interested in topic2, and then skip to the conclusion.
> 
> You are essentially talking about a table of contents (TOC), and the
> two approaches are:
> 
>  1) include an explicit list of chapters [offset,title] in the file header
>  2) include markers in the stream at the start of each chapter
> 
> The advantage of an explicit TOC is that it is quick to parse and then
> jump to arbitrary points. The disadvantage is that it is only useful
> to apply to finished files (ie. impossible to apply to live streams).
> 
> The advantage of in-stream markers is that they can be added during
> streaming of live content, ie. before production of the entire file is
> finished. The disadvantage is that the whole on-disk file needs to be
> scanned to find them (ie. inefficient to apply to disk files).

Are these two already well defined and documented?

It's probably not so hard to have both, e.g. if I save streamed ogg video to
a file I could convert 2) into 1) on the fly.

> 
> The design of Ogg has generally leaned towards streamability, ie. not
> including too much information in the up-front headers.

That's OK. But just because you have streaming in mind, you shouldn't forget
the other usecases of a free container format. There _are_ people (me being one
of them), who would like to convert a DVD movie into a file without losing
information like chapters and subtitles. And use Ogg Theora and Ogg Vorbis.

> 
> The inefficiency of the in-stream approach can be overcome by caching:
> an application can scan the file once and store the TOC in a separate
> file.

It might be more straight forward to add 1) or 2) if it's missing. They can
both be converted into each other.

>  * For a desktop media player this is straightforward: cache the
> chapter offsets, and offer a navigation menu.

That's what DVD players do. If the file has 1), it's easy. If it has 2), it
requires scanning the whole thing. But afterwards, 1) could be added to the
header (that probably requires copying the whole file, but that should be
a minor problem).

>  * For a web application: access to the chapters can be made available
> through the URL for the video stream, using the ?id= or #id= syntax
> (currently in draft in the W3C Media Fragments WG).
> 
> Of course it is useful, especially for desktop apps, to use a common
> TOC format. The same TOC file can be shared between multiple versions
> of the same video content, varying by codecs and encoding quality
> levels. Any suggestions for a TOC file format, preferably documented?

I'd vote against that. If 1) and 2) is documented, there's no need for an
extra file.

Thanks,
Hans



More information about the ogg-dev mailing list