[FFmpeg-devel] [PATCH 3/4] doc: document swr async

Stefano Sabatini stefasab at gmail.com
Mon Dec 24 00:47:28 CET 2012


On date Sunday 2012-12-23 19:34:54 +0100, Michael Niedermayer encoded:
> On Sun, Dec 23, 2012 at 06:41:21PM +0100, Stefano Sabatini wrote:
> > On date Sunday 2012-12-23 00:07:13 +0100, Michael Niedermayer encoded:
> > > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > > ---
> > >  doc/filters.texi |    7 +++++++
> > >  1 file changed, 7 insertions(+)
> > > 
> > > diff --git a/doc/filters.texi b/doc/filters.texi
> > > index f456d03..45d85f9 100644
> > > --- a/doc/filters.texi
> > > +++ b/doc/filters.texi
> > > @@ -428,6 +428,13 @@ timestamps, do a combination of both or do neither.
> > >  The filter accepts the following named parameters:
> > >  @table @option
> > >  
> > > + at item async
> > > +simple 1 parameter audio sync to timestamps using stretching/squeezing/filling
> > > +and trimming. Setting this to 1 will enable filling and trimming, larger
> > > +values represent the maximum amount in samples that the data may be
> > > +stretched or squeezed.
> > 
> > 1 == inconditional squeezing/trimming/filling?
>
> inconditional is no english word

I mean what's the difference between 1 (filling/trimming) and >1
(squeezing/stretching)?

Elaborating more on the difference between filling/trimming and
stretching/squeezing. Let A = async value.

Suppose we get two audio packets (what I call "audio frames") with the
following temporal layout:

t---->
s0                e0
v                 v
------------------
            s1             e1
            v              v
            ---------------

Now since we have e0 > s1 we have an overlap, so we need to squeeze
the samples from the second packet, which we do by *squeezing* the
samples, which results in eliminating A samples per seconds.

t---->
s0                e0
v                 v
------------------
                       s1             e1
                       v              v
                       ---------------

The second scenario corresponds to *stretching*, in this case we
stretch the number of samples per second by A.

What I'm not sure is if trimming/filling is equivalent to
squeezing/stretching or has an entirely different meaning (which is
not clear/specified in the docs).

> > 
> > Amount in samples = samples per channel?
> 
> the stretching/squeezing/filling and trimming is applied to each
> channel equally and independant of other channels
> 
> 
> > 
> > Also the amount in samples represents the maximum number of samples in
> > the current samples frame?
> 
> I dont know what you mean by "samples frame"

I figured it out from your other post:

values represent the maximum amount in samples _for each second_ that
the data may be stretched or squeezed.

> 
> 
> > 
> > > +The default is disabled
> > 
> > 0 = no adjustements?
> 
> yes

I suggest:

Default value is 0, thus the synchronization compensation behavior is
disabled.

> 
> 
> > What if the value is between 0 and 1?
> 
> undefined

Thanks for taking the time to explain this.
-- 
FFmpeg = Friendly and Fast Merciful Prodigious Ecletic God


More information about the ffmpeg-devel mailing list