[FFmpeg-devel] [PATCH] libavfilter: add atempo filter (revised patch v5)

Stefano Sabatini stefasab at gmail.com
Thu Jun 14 01:17:16 CEST 2012

On date Wednesday 2012-06-13 11:05:39 -0600, Pavel Koshevoy encoded:
> On 6/13/2012 9:48 AM, Nicolas George wrote:
> You've stated that the PTS has to be consistent with playback
> duration, which in my understanding is a sum of samples output so
> far.  I admit the above calculation assumes 0 PTS as input stream
> origin.  I'll see what I can do to accommodate streams that start
> from non-0 PTS.

> The difficulty is that this filter is meant to be used interactively
> -- user may seek (this affects input stream PTS origin) or change
> tempo at any time.  Suggestions for handling these scenarios
> gracefully are welcome.

I'm actually working on this, but this may require some time as I'm
not fully allocated on it.

My plan: add frame duration support in libavfilter (right now we have
AVFrame.pkt_duration which corresponds to a frame duration for video,
and we can compute the duration in case of audio samples with simple
arithmetic given the samplerate and the number of samples).

Then we need to add support to seeking in movie source (audio and
video, and possibly merge audio and video movie in a single source
with a configurable number of A/V outputs). PTS audio normalization
can be done through an asetpts filter (still to integrate, there is a
patch by Andrei Utkin but needs some factorization with the video
setpts filter).

As for sending interactive events... right now we inject events in the
filtergraph, check for example how it is done in ffmpeg.c. Another
idea may be to make accessible the filtergraph structure from a
filter, so you can have filters which inject events in the filtergraph
(for example: a filter which sends events programmatically, or a
custom widget panel which can control interactively several "events").
FFmpeg = Fascinating and Free Muttering Patchable Elected Geisha

More information about the ffmpeg-devel mailing list