Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jan 2003 08:22:31 +0100
From:      Andre Albsmeier <andre.albsmeier@siemens.com>
To:        "Steve O'Hara-Smith" <steve@sohara.org>
Cc:        Andre Albsmeier <andre.albsmeier@siemens.com>, freebsd-multimedia@FreeBSD.ORG
Subject:   Re: AV sync on ffmpeg captures - was Re: FreeBSD 4.7R: no sound when recording with ffmpeg?
Message-ID:  <20030110082231.A32663@curry.mchp.siemens.de>
In-Reply-To: <20030109192247.0602e203.steve@sohara.org>; from steve@sohara.org on Thu, Jan 09, 2003 at 07:22:47PM %2B0100
References:  <20021028202230.1283e8cd.steve@sohara.org> <Pine.BSF.4.21.0210292118440.11617-100000@brain.stagecraft.cx> <20021029194220.7fb532ad.steve@sohara.org> <20030106115851.A12349@curry.mchp.siemens.de> <20030106215821.60130d42.steve@sohara.org> <20030107085526.A14263@curry.mchp.siemens.de> <20030107191359.12abeb78.steve@sohara.org> <20030109144913.A30175@curry.mchp.siemens.de> <20030109192247.0602e203.steve@sohara.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 09-Jan-2003 at 19:22:47 +0100, Steve O'Hara-Smith wrote:
> On Thu, 9 Jan 2003 14:49:13 +0100
> Andre Albsmeier <andre.albsmeier@siemens.com> wrote:
> 
> AA> On Tue, 07-Jan-2003 at 19:13:59 +0100, Steve O'Hara-Smith wrote:
> AA> > On Tue, 7 Jan 2003 08:55:26 +0100
> AA> > 	Please do, it would be good to confirm that the problem is not in
> AA> > mplayer (I suspect it isn't but confirmation is good and I have no
> AA> > windows).
> AA> 
> AA> Hmm, tried the file in question with "Zoom Player" under Win32 and
> AA> here the sync is perfect! So far so good, now one would say this is an
> AA> mplayer problem. But there are two things left:
> AA> 
> AA> 1.) I played lot of other mpegs using mplayer and the audio sync is
> AA> ok.
> 
> 	Yep - I've played a lot of VOBs and AVIs in mplayer without sync
> problems too. Timestamping in streams is an amazingly complex thing (ie.

Well, let me ask you one question: What happens if you play a ffmpeg
generated stream with mplayer? Is the problem reproducible?

> I haven't managed to grok it yet). There are AFAICT multiple ways to work
> out when things should be played, there is probably a consistency problem
> in the streams generated by ffmpeg.
> 
> 	What this tells me is that I shouldn't try and fix this in the grab
> code which is probably behaving well now, it needs fixing in the ffmpeg

Yep, the fact that Zoom Player plays the file properly let's us assume
that everything is allright with the grabbing.

> stream building code (somewhere) which I don't understand properly (the
> last time I tried to fiddle with it strange and unexpected things
> happened, I retreated in confusion). It may be better in ffmpeg 0.46
> unfortunately the performance of 0.46 leaves much to be desired - my XP
> can't quite keep up with half resolution recording under 0.46 :(.
> 
> AA> 2.) When I use Virtualdub (which also runs under Win32 and has nothing
> AA> to
> AA>     do with mplayer)
> 
> 	It probably digs out the timing in the same way as mplayer. What
> happens if you just play back the stream with mplayer -fps 25.045 (or
> perhaps about 24.95) ?

This doesn't help a lot. The interesting thing is, when playing without
the -fps option, mplayer tells me that the frame rate is 25.00:

Playing test.mpg
Detected MPEG-PS file format!
VIDEO:  MPEG1  384x288  (aspect 1)  25.00 fps  12000.0 kbps (1500.0 kbyte/s)
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3

This would mean that it parsed some MPEG header data correctly. When using
the -fps option it tells me:

FPS forced to be 25.045  (ftime: 0.040)
Start playing...

However, I have got the impression that the whole -fps stuff doesn't
work a good as it should be. E.g., if you use -fps and let a file
play normally until a certain position, the AV-offset is different as
it is if you seek 20 seconds before the same point and let it play
from there.


> 
> 	Can anyone point me to a comprehensible description of how the
> timestamping is supposed to work in mpeg and avi streams ? If I can grok
> what is supposed to be going on I can take a crack at fixing it.

Unfortunately, I can't help here. But in case you want me to do some
tests I am happy to help...

	-Andre

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030110082231.A32663>