ffmpegでインターレースかプログレッシブかの判別方法
code:sh
ffmpeg -t ${duration} -i ${input_name} -vf idet -an -sn -f null -
- 上記コマンド実行後のアウトプットで出力される Multi frame detectionを元に以下の式でチェック
ex)
TFF: 11254
BFF: 25230
Progressive: 199110
FF=11254+25230=36484
36484/(36484+199110) > 0.2
0.1548... > 0.2 => false progressive
ff = tff + bff
ff / (ff + progressive) > 0.2(閾値) = true => interlace
ex) ffmpeg -t 600.446000 -i movie_5_5_deinterlace.mp4 -vf idet -an -sn -f null -
Parsed_idet_0 @ 0x7fd199c09000 Repeated Fields: Neither: 18008 Top: 1 Bottom: 5
Parsed_idet_0 @ 0x7fd199c09000 Single frame detection: TFF: 2347 BFF: 3359 Progressive: 5797 Undetermined: 6511
Parsed_idet_0 @ 0x7fd199c09000 Multi frame detection: TFF: 2666 BFF: 4313 Progressive: 11032 Undetermined: 3
`