[FFmpeg-devel] [PATCH] vf_fps: uses the last frame duration to duplicate it if needed

Nicolas George george at nsup.org
Thu Sep 7 21:37:30 EEST 2017


[ Ccing you, but no need to Cc me. ]

Le primidi 21 fructidor, an CCXXV, Thierry Foucu a écrit :
> Sorry I did not know and I did not see any documentation in the header
> explaining which field of the AVFrame can/cannot be used by filter.

Yes, it lacks documentation.

> If we cannot used the duration of the AVframe, how can we resolve the
> problem I'm trying to resolve.
> For example, if you take a video with a fps of 1 frame/second and you are
> trying to convert it to 30fps, the duration of the output file will be
> shorter by 1 second.
> Knowing the last frame duration allows us to pad the last video frame with
> the correct fps.
> 
> You are saying there is an old patch series to ensure it. How far are you
> with it?
> With the patch you are talking about, will we be able to do what i'm trying
> to do with this patch?

Yes, it is meant exactly for that. The patch series I was referring is
this one:

https://ffmpeg.org/pipermail/ffmpeg-devel/2017-September/215988.html
https://patchwork.ffmpeg.org/patch/5024/
(and next)

I thought I had cced you on one of the patches, but it may have been
ignored.

With this patch series, when a filter reaches EOF, the link->current_pts
contains the timestamp of the end, including the duration of the last
frame: from that, you can implement your patch in a very similar way.

(Although vf_fps would need to be rewritten to take advantage of the
link's FIFO, but that is more work, and not required immediately.)

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170907/0f8f51ad/attachment.sig>


More information about the ffmpeg-devel mailing list