From owner-freebsd-multimedia Thu Jan 9 23:22:47 2003 Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C262B37B401 for ; Thu, 9 Jan 2003 23:22:44 -0800 (PST) Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 42AD843E4A for ; Thu, 9 Jan 2003 23:22:43 -0800 (PST) (envelope-from andre.albsmeier@siemens.com) Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by goliath.siemens.de (8.11.6/8.11.6) with ESMTP id h0A7MXE21881; Fri, 10 Jan 2003 08:22:34 +0100 (MET) Received: from mars.cert.siemens.de (ust.mchp.siemens.de [139.23.201.17]) by mail3.siemens.de (8.11.6/8.11.6) with ESMTP id h0A7MXp10315; Fri, 10 Jan 2003 08:22:33 +0100 (MET) Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7]) by mars.cert.siemens.de (8.12.7/8.12.7/$SiemensCERT: mail/cert.mc,v 1.40 2003/01/07 15:49:50 ust Exp $) with ESMTP id h0A7MWrM009426; Fri, 10 Jan 2003 08:22:33 +0100 (CET) Received: (from localhost) by curry.mchp.siemens.de (8.12.6/8.12.6) id h0A7MWoJ095898; Date: Fri, 10 Jan 2003 08:22:31 +0100 From: Andre Albsmeier To: "Steve O'Hara-Smith" Cc: Andre Albsmeier , 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> References: <20021028202230.1283e8cd.steve@sohara.org> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030109192247.0602e203.steve@sohara.org>; from steve@sohara.org on Thu, Jan 09, 2003 at 07:22:47PM +0100 X-Echelon: fraud, 737, Embassy, SEMTEX, AA Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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 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