videoffmpeginterlacing

FFmpeg Idet with Timecode/Frame Number?


Is it possible to get ffmpeg to tell you which frames it thinks are interlaced/progressive when running the idet filter?

My use case is that when interlaced frames are detected in a file I need to be able to know which frames ffmpeg thinks are interlaced so I can easily pull them up and check if ffmpeg was correct in its assessment. Sometimes aliasing and thin lines in animation throw it off.


Solution

  • The idet filter stores the per-frame determination as metadata which can be dumped to file using the metadata filter e.g.

    ffmpeg -i input -vf idet,metadata=print:file=idet.log -f null -
    

    Each frame log is of the form,

    frame:2    pts:1024    pts_time:0.0666667
    lavfi.idet.repeated.current_frame=neither
    lavfi.idet.repeated.neither=3.00
    lavfi.idet.repeated.top=0.00
    lavfi.idet.repeated.bottom=0.00
    lavfi.idet.single.current_frame=progressive
    lavfi.idet.single.tff=0.00
    lavfi.idet.single.bff=0.00
    lavfi.idet.single.progressive=2.00
    lavfi.idet.single.undetermined=1.00
    lavfi.idet.multiple.current_frame=progressive
    lavfi.idet.multiple.tff=0.00
    lavfi.idet.multiple.bff=0.00
    lavfi.idet.multiple.progressive=2.00
    lavfi.idet.multiple.undetermined=1.00