[FFmpeg-user] Mixed telecined non-telecined media to constant frame rate.
Nicholas Robbins
nickrobbins at yahoo.com
Wed Jan 22 19:35:39 CET 2014
> On Tuesday, January 21, 2014 12:37 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> > Nicholas Robbins <nickrobbins <at> yahoo.com> writes:
>
>> Indeed if I don't put in any fps filter I see that I
>> have frames at the following pkt_pts's
>> ...
>> 20020
>> 20053
>> 20087
>> 20120*
>> 20187
>> 20220
>> 20254
>> 20287*
>> 20354
>
> I didn't look at the source but it doesn't seem absurd
> to me (although probably buggy) that this is what
> pullup produces (fieldmatch,decimate are worse imo
> because they simply ignore the input timestamps).
So now, I have a suggestion for a new filter. It alters the PTS by something like (pardon the syntax)
NewPTS(i) = Sum(j=0, j<N, OllPTS[i-j])/N + (OldPTS(i)-OldPTS(i-N))*(N-1)/2N
It removes judder in pullup'ed cases if the original was 24->30 converted, with N=4. If the original was 25->30 then N=5 works. If N=20 it does both.
It leaves non-juddered sections alone regardless of N (it does introduce N frames of judder at any transition)
Ideally it would also multiply the timebase by 2N. (so that the new PTS's are garunteed to be integers)
Should I move this conversation over to ffmpeg-devel? I can code myself for hobby and academic purposes, but have never contributed to something as big as ffmpeg.
For example, with N=4, it takes the quoted
>> 20020
>> 20053
>> 20087
>> 20120*
>> 20187
>> 20220
>> 20254
>> 20287*
>> 20354
and turns it into
160059
160393
160727
161061
161395
161729
162063
162397
162731
of course the timebase would have to be adjusted by *8.
-Nick Robbins
More information about the ffmpeg-user
mailing list