[FFmpeg-devel] [PATCH] lavfi/fps: rescale input PTS immediately.

Nicolas George george at nsup.org
Sat Jan 25 22:24:40 CET 2014

Le sextidi 6 pluviôse, an CCXXII, Michael Niedermayer a écrit :
> using the output timebase for input timestamps is flawed, and cannot
> work optimally because it discards information that is required
> consider input at 1/100 timebase and output at 1/1 timebase
> for each output frame one input frame has to be selected.
> There may be between 0 and 100 frames during the display interval of
> a specific output frame.
> Along one direction of argumentation, the best choice to represent
> the interval from second 7 to second 8
> would be a frame, which has its middle of its display interval closest
> to the time 7.5sec
> but if you have 5 frames with timestamp 7 and 5 with timestamp 8
> which frame that is has been lost
> another way to argue about which frame is best would bias toward
> even spacing, so if the input frames are very asymetrically placed
> like 0, 0.9, 1.9, 2.1, 2.9, 3.9
> that output should on fps 1/1 be using 0, 0.9, 1.9, 2.9, 3.9 it should
> not pick the frames at 0, 1.9, 2.1, 3.9 because they are poorly
> distributed. Again this isnt possibly when the input timestamps have
> been rounded into the output timebase
> There are other lines of argumentation what is best but discarding
> the exact input timestamps probably causes problems to them as well

The current implementation of vf_fps does not do that kind of heuristics, it
only selects the first frame in the interval.

If someone wants to implement them, they can use the timestamp as they see
fit, but right now, this patch is very simple, makes the code more readable
and fixes an open bug.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140125/8aa51562/attachment.asc>

More information about the ffmpeg-devel mailing list