Detect video interlacing type.
This filter tries to detect if the input frames are interlaced, progressive, top or bottom field first. It will also try to detect fields that are repeated between adjacent frames (a sign of telecine).
Single frame detection considers only immediately adjacent frames when classifying each frame. Multiple frame detection incorporates the classification history of previous frames.
The filter will log these metadata values:
- single.current_frame
-
Detected type of current frame using single-frame detection. One of: “tff” (top field first), “bff” (bottom field first), “progressive”, or “undetermined”
- single.tff
-
Cumulative number of frames detected as top field first using single-frame detection.
- multiple.tff
-
Cumulative number of frames detected as top field first using multiple-frame detection.
- single.bff
-
Cumulative number of frames detected as bottom field first using single-frame detection.
- multiple.current_frame
-
Detected type of current frame using multiple-frame detection. One of: “tff” (top field first), “bff” (bottom field first), “progressive”, or “undetermined”
- multiple.bff
-
Cumulative number of frames detected as bottom field first using multiple-frame detection.
- single.progressive
-
Cumulative number of frames detected as progressive using single-frame detection.
- multiple.progressive
-
Cumulative number of frames detected as progressive using multiple-frame detection.
- single.undetermined
-
Cumulative number of frames that could not be classified using single-frame detection.
- multiple.undetermined
-
Cumulative number of frames that could not be classified using multiple-frame detection.
- repeated.current_frame
-
Which field in the current frame is repeated from the last. One of “neither”, “top”, or “bottom”.
- repeated.neither
-
Cumulative number of frames with no repeated field.
- repeated.top
-
Cumulative number of frames with the top field repeated from the previous frame’s top field.
- repeated.bottom
-
Cumulative number of frames with the bottom field repeated from the previous frame’s bottom field.
The filter accepts the following options:
- intl_thres
-
Set interlacing threshold.
- prog_thres
-
Set progressive threshold.
- rep_thres
-
Threshold for repeated field detection.
- half_life
-
Number of frames after which a given frame’s contribution to the statistics is halved (i.e., it contributes only 0.5 to its classification). The default of 0 means that all frames seen are given full weight of 1.0 forever.
- analyze_interlaced_flag
-
When this is not 0 then idet will use the specified number of frames to determine if the interlaced flag is accurate, it will not count undetermined frames. If the flag is found to be accurate it will be used without any further computations, if it is found to be inaccurate it will be cleared without any further computations. This allows inserting the idet filter as a low computational method to clean up the interlaced flag
Examples
Inspect the field order of the first 360 frames in a video, in verbose detail:
ffmpeg -i INPUT -filter:v idet,metadata=mode=print -frames:v 360 -an -f null -
The idet filter will add analysis metadata to each frame, which will then be discarded. At the end, the filter will also print a final report with statistics.