[DVDnav-discuss] determining the exact size of a stream

Sergey 'Jin' Bostandzhyan jin at mediatomb.cc
Mon Sep 15 18:08:15 CEST 2008


Hi,

thanks for the fast response.

On Mon, Sep 15, 2008 at 05:19:22PM +0200, Nico Sabbi wrote:
> > It was quite a pain to figure out how to use the library,
> > play_title.c from libdvdread 0.9.7 was a great help, btw I noticed
> > that it is no longer included in the forked release. So first
> > question: are there any plans to add a somewhat higher level,
> > easier to use API?
> 
> libdvdnav is the high-level,  easy to use library

My understanding was, that libdvdnav requires user interaction, which is not
really possible in my case.

Or is there a way to get the information from the DVD using libdvdread (the
way I am doing it now), and then pass that information to libdvdnav in order
to get the stream for the selected title/chapter/angle?

Basically, I receive a HTTP GET request from the player and I need to write
the MPEG stream for a particular title/chapter/angle selection to the socket.

I may receive a HTTP range request when the player wants to seek.

Pausing is either done by tearing down the TCP connection and issuing another
range request for resuming, or by suspending the read operation.

Can the above be done with the help of libdvdnav?

> > Implementing seeking support is next on my list, most UPnP players
> > do this via HTTP range requests, so I need to know the size of the
> > stream in bytes.
> >
> > And here is the problem:
> > in order to get the exact size I need to read nav packets, then
> > parse the dsi packets and basically follow the flow of the cells.
> 
> there's nothing like that, that I remember, in dvdnav, but it
> can be added

That would be nice...


> > Unfortunately this requires reading and parsing through the whole
> > DVD and takes up to 30 seconds or more. I tried to calculate the
> > length by using the sector information which seemed to be very
> > fast, but the results were simply wrong.
> >
> > Is there a way that would allow to quickly determien the size of
> > the MPEG stream for a particular title/chapter/angle selection?
> >
> > In case anyone is interested to see my attempts :)
> > http://mediatomb.svn.sourceforge.net/viewvc/mediatomb/trunk/mediato
> >mb/src/dvd_read.cc?revision=1877&view=markup
> >
> (in the PGC) should suffice

So something like that (which I already tried):
    do
    {
        len += (this->pgc->cell_playback[curcell].last_sector -
                this->pgc->cell_playback[curcell].first_sector + 1)
            *DVD_VIDEO_LB_LEN;
        curcell++;
    } while (curcell < pgc->nr_of_cells);

Unfortunately, depending on the DVD, the length is often way off, when using
this method.

Kind regards,
Jin




More information about the DVDnav-discuss mailing list