[FFmpeg-devel] [PATCH 3/4] Add setpts filter by Victor Paesa.

Michael Niedermayer michaelni
Mon Nov 1 14:13:02 CET 2010


On Sun, Oct 31, 2010 at 01:33:07AM +0200, Stefano Sabatini wrote:
> On date Thursday 2010-06-17 22:33:30 +0200, Michael Niedermayer encoded:
> > On Thu, Jun 17, 2010 at 10:17:17PM +0200, V?ctor Paesa wrote:
> > > Hi,
> > > 
> > > On 2010-06-17, Michael Niedermayer wrote:
> > > > On Thu, Jun 17, 2010 at 12:48:37AM +0200, Stefano Sabatini wrote:
> > > >> On date Wednesday 2010-06-09 03:39:04 +0200, Michael Niedermayer encoded:
> > > >> > On Wed, Jun 09, 2010 at 12:17:35AM +0200, Stefano Sabatini wrote:
> > > >> > > ---
> > > >> > >  doc/libavfilter.texi     |   46 +++++++++++++++++
> > > >> > >  libavfilter/Makefile     |    1 +
> > > >> > >  libavfilter/allfilters.c |    1 +
> > > >> > >  libavfilter/vf_setpts.c  |  127
> > > >> > > ++++++++++++++++++++++++++++++++++++++++++++++
> > > >> > >  4 files changed, 175 insertions(+), 0 deletions(-)
> > > >> > >  create mode 100644 libavfilter/vf_setpts.c
> > > >> > >
> > > >> > > diff --git a/doc/libavfilter.texi b/doc/libavfilter.texi
> > > >> > > index 1de27d9..cf53a93 100644
> > > >> > > --- a/doc/libavfilter.texi
> > > >> > > +++ b/doc/libavfilter.texi
> > > >> > > @@ -237,6 +237,52 @@ ratio of the input image.
> > > >> > >
> > > >> > >  The default value of @var{width} and @var{height} is 0.
> > > >> > >
> > > >> > > + at section setpts
> > > >> > > +
> > > >> > > +Change the PTS (presentation timestamp) of the input video frames.
> > > >> > > +
> > > >> > > +Accepts in input an expression evaluated through the eval API, which
> > > >> > > +can contain the following constants:
> > > >> > > +
> > > >> > > + at table
> > > >> > > + at item PTS
> > > >> > > +the presentation timestamp in input
> > > >> > > +
> > > >> > > + at item PI
> > > >> > > +Greek PI
> > > >> > > +
> > > >> > > + at item E
> > > >> > > +Euler number
> > > >> > > +
> > > >> > > + at item AVTB
> > > >> > > +the FFmpeg Time Base
> > > >> > > +
> > > >> > > + at item N
> > > >> > > +the count of the input frame, starting from 0.
> > > >> > > +
> > > >> > > + at item STARTPTS
> > > >> > > +the PTS of the first video frame
> > > >> > > + at end table
> > > >> >
> > > >> > missing:
> > > >>
> > > >> > average fps
> > > >>
> > > >> computed in which interval?
> > > >
> > > > in the one available
> > > > a demuxer with index might even set it exactly
> > > >
> > > >
> > > >>
> > > >> > interlace flag
> > > >> > file position
> > > >>
> > > >> > timebase
> > > >>
> > > >> which timebase? As far as I know the timebase in the filterchain is
> > > >> fixed, and is AV_TIME_BASE.
> > > >>
> > > >> > guessed real minimal timebase
> > > >>
> > > >> please suggest an algorithm for computing it if you have already an
> > > >> idea
> > > >
> > > > Avfilterwhatever.* = AVStream.*
> > > >
> > > >
> > > >>
> > > >> > previous input pts
> > > >> > previous output pts
> > > >>
> > > >> I added them in a previous version, but then I didn't know how to deal
> > > >> with them for the first frame. I suppose they may be set to 0 or
> > > >> AV_NOPTS_VALUE, but then I need to understand how can I deal with
> > > >> them, for example in the expression: outpts=prev_outpts+XXX.
> > > >
> > > > prev= curr - 1/avg_fps
> > > >
> > > >
> > > >>
> > > >> > obviously some of these could be usefull
> > > 
> > > Would it be possible to add "duration" from AVStream too?
> > > More than in vf_setps, I think it would be useful in vf_fade, to make
> > > fade outs at the end of videos.
> > 
> > of course but it might not always be reliable also start_time might be
> > needed too
> 
> Updated.
> -- 
> FFmpeg = Faithless & Fundamentalist Merciless Portable Eccentric Gargoyle

>  doc/filters.texi         |   66 ++++++++++++++++++
>  libavfilter/Makefile     |    1 
>  libavfilter/allfilters.c |    1 
>  libavfilter/vf_setpts.c  |  170 +++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 238 insertions(+)
> 6a90754cd0dede4eeaa1382161c6cf0b13eb1cf7  0003-Add-setpts-filter-ported-from-the-libavfilter-soc-re.patch
> From d4461c8d543b778302273fbf5e6da57ffac4bac8 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Tue, 8 Jun 2010 23:37:31 +0200
> Subject: [PATCH 3/4] Add setpts filter, ported from the libavfilter soc repo.
> 
> ---
>  doc/filters.texi         |   66 ++++++++++++++++++
>  libavfilter/Makefile     |    1 +
>  libavfilter/allfilters.c |    1 +
>  libavfilter/vf_setpts.c  |  170 ++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 238 insertions(+), 0 deletions(-)
>  create mode 100644 libavfilter/vf_setpts.c
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 157f621..19c4d29 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -502,6 +502,72 @@ settb=2*intb
>  settb=AVTB
>  @end example
>  
> + at section setpts
> +
> +Change the PTS (presentation timestamp) of the input video frames.
> +
> +Accept in input an expression evaluated through the eval API, which
> +can contain the following constants:
> +
> + at table @option
> + at item PTS
> +the presentation timestamp in input
> +
> + at item PI
> +Greek PI
> +
> + at item PHI
> +golden ratio
> +
> + at item E
> +Euler number
> +

> + at item TBNUM, TBDEN
> +input timebase numerator and denomimator

why seperate ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101101/503c443d/attachment.pgp>



More information about the ffmpeg-devel mailing list