Have you ever come across a video file that on the tin states that it is interlaced but when you view it, it isn't? If you then take that file and apply a de-interlacing filter to it, the filter may have a negative impact on quality for absolutely no reason.
Now, with a small pipeline where you are able to view each video yourself this can be caught, but a pipeline with hundreds, thousands, millions, no.
FFMPEG includes a nifty video filter called 'idet' that scans the video image for combing effects and produces a report on the amount of interlaced and non-interlaced frames it has determined. It also, if it finds a interlaced frame, tell you the scan order. Here's an example command line:
This filter does require FFMPEG to decode the video so it may take a while. When I implement this in a pipeline I would only process enough of the video that I believe will give a good reading. This example I have said that to be just the first minute of the video.
The output looks like this:
These numbers could be gathered by regex and calculated with a simple max() function like so: