最近遇到要识别隔行扫描的视频加以特殊转码处理的问题。google了一番以后找到两个解决的方式,记录一下。
方法一:使用隔行扫描检查滤镜idet区分隔行扫描和逐行扫描
ffmpeg -filter:v idet \
-frames:v 100 \
-an \
-f rawvideo -y /dev/null \
-i 351.mp4
# Example output (this is not interlaced):
# [Parsed_idet_0 @ 0x1bcf720] Single frame detection: TFF:0 BFF:0 Progressive:564 Undetermined:84
# [Parsed_idet_0 @ 0x1bcf720] Multi frame detection: TFF:0 BFF:0 Progressive:623 Undetermined:25