From owner-freebsd-multimedia Sun Jan 12 5:38:57 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 A316C37B401 for ; Sun, 12 Jan 2003 05:38:54 -0800 (PST) Received: from thoth.sbs.de (thoth.sbs.de [192.35.17.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 182B543F13 for ; Sun, 12 Jan 2003 05:38:53 -0800 (PST) (envelope-from andre.albsmeier@siemens.com) Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.11.6/8.11.6) with ESMTP id h0CDcgA29025; Sun, 12 Jan 2003 14:38:43 +0100 (MET) Received: from mars.cert.siemens.de (ust.mchp.siemens.de [139.23.201.17]) by mail2.siemens.de (8.11.6/8.11.6) with ESMTP id h0CDcgg06474; Sun, 12 Jan 2003 14:38:42 +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 h0CDcf1h037211; Sun, 12 Jan 2003 14:38:41 +0100 (CET) Received: (from localhost) by curry.mchp.siemens.de (8.12.6/8.12.6) id h0CDcfoJ024376; Date: Sun, 12 Jan 2003 14:38:40 +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: <20030112143840.A90750@curry.mchp.siemens.de> References: <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> <20030110082231.A32663@curry.mchp.siemens.de> <20030110190040.00bc5dda.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: <20030110190040.00bc5dda.steve@sohara.org>; from steve@sohara.org on Fri, Jan 10, 2003 at 07:00:40PM +0100 X-Echelon: secure shell, unix, Uzi, Sears Tower, Middleman 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 Fri, 10-Jan-2003 at 19:00:40 +0100, Steve O'Hara-Smith wrote: > On Fri, 10 Jan 2003 08:22:31 +0100 > Andre Albsmeier wrote: > > AA> On Thu, 09-Jan-2003 at 19:22:47 +0100, Steve O'Hara-Smith wrote: > AA> > On Thu, 9 Jan 2003 14:49:13 +0100 > AA> > Andre Albsmeier wrote: > > AA> > Yep - I've played a lot of VOBs and AVIs in mplayer without sync > AA> > problems too. Timestamping in streams is an amazingly complex thing > AA> > (ie. > AA> > AA> Well, let me ask you one question: What happens if you play a ffmpeg > AA> generated stream with mplayer? Is the problem reproducible? > > I haven't seen slippage since the last iteration of the grab code, > before that I did. I don't think you are the only one seeing it now > though. > > AA> This doesn't help a lot. The interesting thing is, when playing > AA> without the -fps option, mplayer tells me that the frame rate is > AA> 25.00: > > Good the header is at least partially valid :) > > AA> However, I have got the impression that the whole -fps stuff doesn't > AA> work a good as it should be. E.g., if you use -fps and let a file > AA> play normally until a certain position, the AV-offset is different as > AA> it is if you seek 20 seconds before the same point and let it play > AA> from there. > > Ugh! > > AA> Unfortunately, I can't help here. But in case you want me to do some > AA> tests I am happy to help... > > Thanks, I'll let you know if/when I get anywhere with it. Well, I think, I have interesting news on it. I think it is best if I tell you the whole story: I am collecting Laurel and Hardy movies :-). I have a specific movie in good quality but in english. Today the same movie appeared in TV in german language. Since the quality of the english version was a lot better, I decided to try to mix the german sound with the english movie. This is what I did: 1. Grab the german movie using ffmpeg -y -vcodec mpeg1video -me zero -intra -b 9600 -s 384x288 -ac 2 -ab 224 2. Load the resulting mpg into virtual dub. 3. Save the raw audio track to harddisk. 4. Load the english movie into virtual dub. 5. Selected the german audio track. 6. Wrote the resulting movie to disk. The result was interesting: The new movie had a growing audio offset as well. The first shot I tried was to use 25.045 as the new frame rate. No the audio was perfect in sync! Since the orignal english version was coming from the internet (not grabbed by myself), I assume that the audio part in ffmpeg generated movies has it's problems. I also played both movies simultaneously and they were playing nearly synchronously (picture-wise). Could it be that the audio sampling rate does not correspond to what ffmpeg is thinking? This could also explain why others don't see the de-sync effects if they use a different sound card. I have got the pcm0: at io 0x220 irq 5 drq 1:5 bufsz 4096d (1p/1r/0v channels duplex) I will experiment a bit with the soundcard as soon as time permits. Just an idea, -Andre To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message