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

Michael Niedermayer michaelni at gmx.at
Sat Jan 25 23:30:00 CET 2014


On Sat, Jan 25, 2014 at 10:24:40PM +0100, Nicolas George wrote:
> 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.

true


> 
> 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.

alternative fix for ticket 3329 posted
please comment

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140125/d89ed0ce/attachment.asc>


More information about the ffmpeg-devel mailing list