From Franck.Sicard@miniruth.solsoft.fr Tue, 2 Nov 1999 15:13:37 +0100
Date: Tue, 2 Nov 1999 15:13:37 +0100
From: Franck SICARD Franck.Sicard@miniruth.solsoft.fr
Subject: [Livid-dev] nist: video/audio synchronization

Hi,

there is a big video/audio synchronization problems with nist:

I am doing the tests on a Dual PII 450.

if i play an extracted vob without any specials options
(mpeg2player -vob -f my_file.vob)
the frame rate is around 20 f/s, the display not smooth and
there is some lag in the audio track rendering.

if i disable audio synchronization (mpeg2player -ns -vob -f my_file.vob)
the rendering is smooth, around 25 frame/seconds no more lag in the
audio rendering and the seems to stay in synchro.

	Franck

From Joachim.Koenig@tecnomen.fi Tue, 2 Nov 1999 17:58:50 +0200
Date: Tue, 2 Nov 1999 17:58:50 +0200
From: Joachim Koenig Joachim.Koenig@tecnomen.fi
Subject: [Livid-dev] nist: video/audio synchronization

Hi,

> there is a big video/audio synchronization problems with nist:
> 
> I am doing the tests on a Dual PII 450.
> 
> if i play an extracted vob without any specials options
> (mpeg2player -vob -f my_file.vob)
> the frame rate is around 20 f/s, the display not smooth and
> there is some lag in the audio track rendering.
> 
> if i disable audio synchronization (mpeg2player -ns -vob -f my_file.vob)
> the rendering is smooth, around 25 frame/seconds no more lag in the
> audio rendering and the seems to stay in synchro.
> 
	I'm perfectly aware of this problem. It is on my todo list for a
long time now,
	but so far I could not track it down. 

	mfg
	Joachim

From Franck.Sicard@miniruth.solsoft.fr Tue, 2 Nov 1999 21:48:35 +0100
Date: Tue, 2 Nov 1999 21:48:35 +0100
From: Franck SICARD Franck.Sicard@miniruth.solsoft.fr
Subject: [Livid-dev] nist: video/audio synchronization

On Tue, Nov 02, 1999 at 05:58:50PM +0200, Joachim Koenig wrote:
> 	I'm perfectly aware of this problem. It is on my todo list for a
> long time now,
> 	but so far I could not track it down. 

OK,

2 others things:

1) there is also a problem with the "-fr" flag because when using it i
   can never have more than 22 fps, (and it isn'nt because i have
   no more B frame to skip). After looking at the source, i get 
   a little lost (to much classes every where for my taste), but i
   found the second thing:

2) in video/display.cc when we are in 565 mode the fonction
   Color16DitherImageMod() is called for the YUV->RGB conversion
   instead of yuv_2_rgb(). But yuv_2_rgb() seems a little faster.
   (i havent exact figure because when using it, mpeg2play dump a core
    just before exiting (after printing the statistics) and time
    dosn't return the elapsed user time :-( ).

	Franck (continuing his digging in the code).

From alan@lxorguk.ukuu.org.uk Wed, 3 Nov 1999 22:32:53 +0000
Date: Wed, 3 Nov 1999 22:32:53 +0000
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] AC3 failures with Zorro (region 2)

This is the AC3 decode report

(crc) CRC check passed
(sync) 0 bits skipped to synchronize
(sync) begin frame 57
(syncinfo) 48 KHz    384 kbps  768 words per frame
(bsi) CM 5.1 Mode  Centre Mix Level (-3.0 dB)  Sur Mix Level (-3.0 dB) 
(audblk) cpl on  bai  snroffst          (D25  D25  D25  D25  D25 ) 
(audblk) cpl on                         (R    R    R    R    R   ) 
(audblk) cpl on                         (R    R    R    R    R   ) 
(audblk) cpl on                         (R    R    R    R    R   ) 

!! Invalid mantissa !!

!! Invalid mantissa !!

!! Invalid mantissa !!
(audblk) cpl on  bai  snroffst  deltba  (D45  D45  R    D45  D45 ) 

!! Invalid exponent !!

From alan@lxorguk.ukuu.org.uk Wed, 3 Nov 1999 23:46:29 +0000
Date: Wed, 3 Nov 1999 23:46:29 +0000
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] Audio Sync Failure

I've been looking at this. I've yet to dig into the depths of the sync
object but it is very noticable that the mpegaudio decoder module makes
calles to the sync object indicating what it has used and waiting for
stuff that the ac3 one does not.

Unfortunately NIST is very hard to follow

Alan

From alan@lxorguk.ukuu.org.uk Thu, 4 Nov 1999 00:10:32 +0000
Date: Thu, 4 Nov 1999 00:10:32 +0000
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] More on the audio errors

I logged the bad exponents - I see exponents of 125 and 127 briefly at the
start of the film then nothing.

Having got it to play I found something else that outweirds me (I don't
follow mpeg internals let me point this out now). The program seemed to
be playing a few frames then jumping back on the video. Well odd. Then
it hit the titles. I get some English, then a jump back to the same frams
in French continuously. Perhaps the ac3 problem is related ?

Alan

From root@ihack.net 03 Nov 1999 21:48:23 -0500
Date: 03 Nov 1999 21:48:23 -0500
From: Charles M. Hannum root@ihack.net
Subject: [Livid-dev] More on the audio errors

Alan Cox < alan@lxorguk.ukuu.org.uk> writes:

> Having got it to play I found something else that outweirds me (I don't
> follow mpeg internals let me point this out now). The program seemed to
> be playing a few frames then jumping back on the video.

AFAICT, this is the effect you see when there are multiple angles.
The demultiplexer does not handle this correctly.

From laredo@gnu.org Thu, 4 Nov 1999 02:05:47 -0500 (EST)
Date: Thu, 4 Nov 1999 02:05:47 -0500 (EST)
From: laredo@gnu.org laredo@gnu.org
Subject: [Livid-dev] More on the audio errors

> Alan Cox < alan@lxorguk.ukuu.org.uk> writes:
> 
> > Having got it to play I found something else that outweirds me (I don't
> > follow mpeg internals let me point this out now). The program seemed to
> > be playing a few frames then jumping back on the video.
> 
> AFAICT, this is the effect you see when there are multiple angles.
> The demultiplexer does not handle this correctly.

The demultiplexer cannot.  It's only possible to parse multiangle files
properly by following the program chains described in the ifo files.

Good luck reverse engineering the format of the ifo file.  There is
considerable work done to date, but so far not enough to parse multiangle
streams properly.

Generally multiangle causes 99% of the new ac3dec problems since the audio
as well as video goes through two separate streams that weren't meant to
be concatenated during playback.

-- Nathan Laredo
laredo@gnu.org

From Joachim.Koenig@tecnomen.fi Thu, 4 Nov 1999 09:18:51 +0200
Date: Thu, 4 Nov 1999 09:18:51 +0200
From: Joachim Koenig Joachim.Koenig@tecnomen.fi
Subject: [Livid-dev] More on the audio errors


> Alan Cox < alan@lxorguk.ukuu.org.uk> writes:
> 
> > Having got it to play I found something else that outweirds me (I don't
> > follow mpeg internals let me point this out now). The program seemed to
> > be playing a few frames then jumping back on the video.
> 
> AFAICT, this is the effect you see when there are multiple angles.
> The demultiplexer does not handle this correctly.
> 
> 
	The demultiplexer _can_ not handle that correctly. Playback of
multiple
	angles is controled by the IFO files. The IFO files define what
sectors on
	the DVD are part of an angle. The player currently reads the VOB
file  
	straigt forward and all angles will be seen in a row. This
	angles "interleaving" seems to cut the audiostream at improper
points.

From alan@lxorguk.ukuu.org.uk Thu, 4 Nov 1999 11:41:08 +0000 (GMT)
Date: Thu, 4 Nov 1999 11:41:08 +0000 (GMT)
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] More on the audio errors

> Good luck reverse engineering the format of the ifo file.  There is
> considerable work done to date, but so far not enough to parse multiangle
> streams properly.

I don't think .IFO files come into this directly. Two reasons

1.	Nobody used to embedded electronics would want to force people to
	cache 300K of .IFO file in a player. 

2.	I get system headers on the right boundaries. Having looked at this
	in the Zorro titles (the one bit I can be sure Im keeping a country
	code) and hacking css-cat a bit I can extract what appears to be
	a valid title sequence in a specific language.

	
My suspicion therefore is that the system header itself contains the
relevant bitmasks to indicate which view it is and the IFO is describing
which views go with which audio and which views are present

Alan

From derek@spider.com Thu, 4 Nov 1999 11:52:35 +0000
Date: Thu, 4 Nov 1999 11:52:35 +0000
From: Derek Fawcus derek@spider.com
Subject: [Livid-dev] More on the audio errors

On Thu, Nov 04, 1999 at 11:41:08AM +0000, Alan Cox wrote:
> 
> 2.	I get system headers on the right boundaries. Having looked at this
> 	in the Zorro titles (the one bit I can be sure Im keeping a country
> 	code) and hacking css-cat a bit I can extract what appears to be
> 	a valid title sequence in a specific language.

  I thought you said last night that the changes I did to css-cat didn't
work? Or have you added/fixed something?  Or is it just that the multiple
angles were messing things up.
> 	
> My suspicion therefore is that the system header itself contains the
> relevant bitmasks to indicate which view it is and the IFO is describing
> which views go with which audio and which views are present

  The fixed part of the system header doesn't contain anything useful.

  The variable part at the end consists of a variable number of records,
the records have two parts.  First an 8 bit 'stream id' second a 16 bit
field describing buffer info.  The stream id will always be >= 0x80.

DF
-- 
Derek Fawcus                                                    derek@spider.com
Spider Software Ltd.                                        +44 (0) 131 475 7034
PGP/GnuPG Keys available

From alan@lxorguk.ukuu.org.uk Thu, 4 Nov 1999 12:15:20 +0000 (GMT)
Date: Thu, 4 Nov 1999 12:15:20 +0000 (GMT)
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] More on the audio errors

>   I thought you said last night that the changes I did to css-cat didn't
> work? Or have you added/fixed something?  Or is it just that the multiple
> angles were messing things up.

I told ac3dec to pretend bogus exponents were valid ones for the moment.
That isnt getting me audio although that may be other problems right now
but means I can play more

>   The variable part at the end consists of a variable number of records,
> the records have two parts.  First an 8 bit 'stream id' second a 16 bit
> field describing buffer info.  The stream id will always be >= 0x80.

That would fit rather well.

The start of Zorro is blocks of 10 system headers in pairs ie

[English][French][Spanish][German][Dutch][English][French]...

style

Later on it drops into a single stream

From derek@spider.com Thu, 4 Nov 1999 12:23:39 +0000
Date: Thu, 4 Nov 1999 12:23:39 +0000
From: Derek Fawcus derek@spider.com
Subject: [Livid-dev] More on the audio errors

On Thu, Nov 04, 1999 at 12:15:20PM +0000, Alan Cox wrote:
> 
> That would fit rather well.
> 
> The start of Zorro is blocks of 10 system headers in pairs ie
> 
> [English][French][Spanish][German][Dutch][English][French]...

  Hmm.  Do you mean there are block of 10 of these 'stream id/buffer info'
fields,  or blocks of 10 of the actual system header?

  Either way,  what's the values in the stream id - if they're there since
their existance is optional.  If they can be filtered out by css-cat...

DF
-- 
Derek Fawcus                                                    derek@spider.com
Spider Software Ltd.                                        +44 (0) 131 475 7034
PGP/GnuPG Keys available

From alan@lxorguk.ukuu.org.uk Thu, 4 Nov 1999 12:29:14 +0000 (GMT)
Date: Thu, 4 Nov 1999 12:29:14 +0000 (GMT)
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] More on the audio errors

> > The start of Zorro is blocks of 10 system headers in pairs ie
> > 
> > [English][French][Spanish][German][Dutch][English][French]...
> 
>   Hmm.  Do you mean there are block of 10 of these 'stream id/buffer info'
> fields,  or blocks of 10 of the actual system header?

The system header is followed by video/audio followed by a system header
followed by video/audio followed by a system header then video/audio in
the next viewangle

>   Either way,  what's the values in the stream id - if they're there since
> their existance is optional.  If they can be filtered out by css-cat...

Great minds think alike 8)


From scarabaeus@convergence.de Thu, 04 Nov 1999 14:05:11 +0100
Date: Thu, 04 Nov 1999 14:05:11 +0100
From: Christian Wolff scarabaeus@convergence.de
Subject: [Livid-dev] More on the audio errors

Alan Cox wrote:
> > Good luck reverse engineering the format of the ifo file.  There is
> > considerable work done to date, but so far not enough to parse multia=
ngle
> > streams properly.
> =

> I don't think .IFO files come into this directly. Two reasons
> =

> 1.      Nobody used to embedded electronics would want to force people =
to
>         cache 300K of .IFO file in a player.

The player only need to hold the VMGI (VIDEO_TS.IFO) and the VTSI of the
title set that is currently played (VTS_xx_0.IFO). And even these two
could be parsed "on the fly", so there isn't even a need to hold them in
RAM. Besides track change times of the DVD drive, of course. And 100K
should be available in even the smallest embedded systems today.

> 2.      I get system headers on the right boundaries. Having looked at =
this
>         in the Zorro titles (the one bit I can be sure Im keeping a cou=
ntry
>         code) and hacking css-cat a bit I can extract what appears to b=
e
>         a valid title sequence in a specific language.

On a DVD, more specific: in a VTS, you have chunks of 2048 byte blocks,
each block a complete MPEG2 packet. These chunks, or "cells", can be put
in a completely random order on the disc. It is just luck, if you have
all the cells of a complete movie in the right order after each other.
Maybe that's the next step of DVD copy protection, writing the cells in
random order onto the disc, instead of sequentially (as most authoring
tools do it today). Then you would have to go by the IFO file
information to untangle the movie.

> My suspicion therefore is that the system header itself contains the
> relevant bitmasks to indicate which view it is and the IFO is describin=
g
> which views go with which audio and which views are present

Unfortunately, the VOB packets aren't bearing any marks of the chain
they belong to. They can, in fact, belong to more than one chain. But
you could split the VOB's in little chunks, each starting with a block
containing private stream 2 headers (0xBF) =


  Christian.

-- =

Christian Wolff     *196807101035    53=B08'2" N    8=B013'20" E
http://www.scarabaeus.org/  mailto:scarabaeus@scarabaeus.org
check out http://betalounge.com/   http://www.convergence.de
+49-30-4473 6926,  Norwegerstr. 5.1, D-10439 Berlin, Germany
PGP Fingerprint:B871 358C 3F10 A5ED C41C B1DB B9F9 3C44/2048

From alan@lxorguk.ukuu.org.uk Thu, 4 Nov 1999 13:13:12 +0000 (GMT)
Date: Thu, 4 Nov 1999 13:13:12 +0000 (GMT)
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] More on the audio errors

> On a DVD, more specific: in a VTS, you have chunks of 2048 byte blocks,
> each block a complete MPEG2 packet. These chunks, or "cells", can be put
> in a completely random order on the disc. It is just luck, if you have
> all the cells of a complete movie in the right order after each other.

Ok. Although it is I suspect more than luck (seek time has to define the
rate you can do more than skip chunks, disk bandwidth defines what 
percentage can be skipped. Wanting to listen to one audio channel and a
different video channel presumably factor in

> Unfortunately, the VOB packets aren't bearing any marks of the chain
> they belong to. They can, in fact, belong to more than one chain. But

The SH is indeed constant now I've dumped it.

> you could split the VOB's in little chunks, each starting with a block
> containing private stream 2 headers (0xBF) =

Ok. So I need to learn about .IFO files. What I do now have for Zorro
is the sector numbers of the SH at the start of each block and a .IFO file
to try and match it with.

Is the existing .IFO knowledge on the net anywhere ?

Alan

From scarabaeus@convergence.de Thu, 04 Nov 1999 14:39:29 +0100
Date: Thu, 04 Nov 1999 14:39:29 +0100
From: Christian Wolff scarabaeus@convergence.de
Subject: [Livid-dev] More on the audio errors

Alan Cox wrote:
> Ok. Although it is I suspect more than luck (seek time has to define th=
e
> rate you can do more than skip chunks, disk bandwidth defines what

Seek time is definitely an issue, if you change cells within the movie.

> percentage can be skipped. Wanting to listen to one audio channel and a=

> different video channel presumably factor in

All audio and SPU streams are recorded interlaced with the adjoining
picture. You'll never have to read seperate areas of the disc for audio
and video. But you have the map_stream_id (ISO/IEC 13818-1) for exactly
this purpose.

> Ok. So I need to learn about .IFO files. What I do now have for Zorro
> is the sector numbers of the SH at the start of each block and a .IFO f=
ile
> to try and match it with.
> =

> Is the existing .IFO knowledge on the net anywhere ?

Thomas 'Dent' Mirlacher <dent@cosy.sbg.ac.at> is working on a free IFO
parser, he posted some stuff in early october on this livid list. I know
some more about IFO files, but i am gagged by the NDA... 8-(
Thomas pointed me to this page: http://reality.sgi.com/nemec/dvd.html,
and it seems, there is some more available on the net. Then there is the
book "DVD Demystified", wich reveals some stuff, too. Overall very
insufficient, i'm afraid to say.

  right on,
    Christian.

-- =

Christian Wolff     *196807101035    53=B08'2" N    8=B013'20" E
http://www.scarabaeus.org/  mailto:scarabaeus@scarabaeus.org
check out http://betalounge.com/   http://www.convergence.de
+49-30-4473 6926,  Norwegerstr. 5.1, D-10439 Berlin, Germany
PGP Fingerprint:B871 358C 3F10 A5ED C41C B1DB B9F9 3C44/2048

From alan@lxorguk.ukuu.org.uk Thu, 4 Nov 1999 17:20:58 +0000 (GMT)
Date: Thu, 4 Nov 1999 17:20:58 +0000 (GMT)
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] More on the audio errors

> >RAM. Besides track change times of the DVD drive, of course. And 100K
> >should be available in even the smallest embedded systems today.

Its actually 300K for the .IFO although chunsk of it are blank.

I've found the list of all section headers and a few other things but not
yet how they all chain together. I did find the language tables though 8)