[FFmpeg-devel] [PATCH] lavfi: add inverse telecine filter

Michael Niedermayer michaelni at gmx.at
Wed Mar 25 14:52:18 CET 2015

On Wed, Mar 25, 2015 at 03:38:18PM +0530, Himangi Saraogi wrote:
> This is an exact inverse of the telecine filter unlike previously existing
> pullup and fieldmatch ones.
> Tested on few samples generated using the telecine filter. Documentation is
> yet to be added. Added an additional parameter "start_frame" to allow using
> the filter for a stream that was cut. Pts handling now uses the input pts, if
> parameter ts_mode is set to 1. Not sure if this fixes the AV_desync though. 

it appears to fix it in some cases but the code is not correct

for example:
./ffmpeg -i matrixbench_mpeg2.mpg -vf telecine,detelecine test.mpg

fills the screen with error messages now


> +    if (s->ts_mode)
> +        outlink->current_pts = inlink->current_pts;


> +        frame->pts = outlink->current_pts + outlink->frame_count * av_q2d(av_inv_q(av_mul_q(outlink->frame_rate, outlink->time_base)));

iam not sure why you use AVFilterLink->current_pts, thats not the
correct field and not used by any other filter.

The inpicref->pts value from the first call represents the start time
this start time must be maintained and should still be on the
corresponding first frame that is output

similarly the telecine filter gets this wrong too and has to be fixed
as well for -vf telecine,detelecine to work. So you will have to
submit 2 patches, one fixing telecine as what telecine
does currently cannot be inverted as it looses the start time

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150325/145f09fd/attachment.asc>

More information about the ffmpeg-devel mailing list