[FFmpeg-devel] How to drop audio samples?

Michael Niedermayer michaelni
Tue May 15 02:37:07 CEST 2007


On Mon, May 14, 2007 at 10:24:55PM +0100, Richard Neill wrote:
> Dear All,
> I wonder whether anyone can offer me advice on how to start tweaking the
> source of ffmpeg. What I'm trying to do is fix the unlocked(*) audio in
> a DV stream (from dvgrab): the camera is actually running its audio
> clock too fast, and sampling at about 48009 Hz, but claiming to sample
> at 48000 exactly. This causes the audio to drift with respect to the
> video - it starts out in sync, but the audio gets behind by about 1
> sec/hour.
> So far, I've tried
>   i)Using -ar 48009 to force the input sample rate to be defined as
> 48009, rather than 48000. However, ffmpeg still treats it as 48000,
> presumably because it trusts the internal DV header. [Is this a bug?]
> ii)Using -async  (which does nothing useful).
> iii)Saving the stream, de-muxing, resampling with sox, and re-muxing:
>    sox -r 48009 input.wav -r 48000 fixed.wav resample
> This works fine, but it's no good for a live stream.
> What I want to do:
> Implement a trivial filter in ffmpeg to drop every nth byte-pair from
> the audio stream.

no what you want to do is rather use -async 10 and ensure that the audio
timestamps are correct

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070515/c753b273/attachment.pgp>

More information about the ffmpeg-devel mailing list