[DVDnav-discuss] determining the exact size of a stream
Sergey 'Jin' Bostandzhyan
jin at mediatomb.cc
Mon Sep 15 16:44:56 CEST 2008
Hi,
recently I found out about the release of the forked libdvdread library,
which is actually a good thing since the original lib seems to be dead.
I did not switch to the forked version yet, but will try it soon. In the
meantime I have a couple of questions and I hope that you guys can help me out.
I am one of the authors of MediaTomb (UPnP media server project), currently
we are adding a feature that should allow users to watch DVDs on their UPnP
players. The idea is to parse the DVD or a DVD iso and create a structure of
virtual objects and containers on the server, which consist of titles,
chapters, audio tracks/languages. Selecting those for playback would extract
the corresponding MPEG stream from the DVD and offer it via HTTP to the
UPnP player.
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?
In the end I was able to get an MPEG stream, matching my title/chatper/angle
selection from the DVD via libdvdread.
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.
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/mediatomb/src/dvd_read.cc?revision=1877&view=markup
Kind regards,
Jin
More information about the DVDnav-discuss
mailing list