2

I am looking for a method to report (not just detect and remove) duplicated frames of video detected by FFmpeg - similar to how you can print out blackdetect, cropdetect, silencedetect, etc.

For example:

ffmpeg -i input.mp4 -vf blackdetect -an -f null - 2>&1 | grep blackdetect > output.txt

Outputs something like:

[blackdetect @ 0x7f8032f03680] black_start:5.00501 black_end:7.00701 black_duration:2.002

But there's no "dupedetect" filter as far as I know, so I'm looking for any ideas/workarounds to get a read of where frames are duplicated.

Calculon
  • 23
  • 5
  • Possible duplicate of [ffmpeg - remove sequentially duplicate frames](https://stackoverflow.com/questions/37088517/ffmpeg-remove-sequentially-duplicate-frames) – Gabriel Devillers Jul 10 '18 at 20:48

1 Answers1

0

Try -vp mpdecimate in the command line.

ffmpeg -i input.mp4 -vf mpdecimate -loglevel debug -an -f null - 2>&1 | grep 'drop_count:\d' > output.txt

Sample line of output:

[Parsed_mpdecimate_0 @ 0x7fbbfa210380] lo:0<2653 lo:0<1326 lo:0<1326 drop pts:101101 pts_time:4.21254 drop_count:1
wizzwizz4
  • 5,219
  • 2
  • 25
  • 49
  • Thanks - though it seems the decimate and fieldmatch video filters don't seem to print out where it's detecting the duplicates, just removes them on an output video. – Calculon Jul 10 '18 at 20:43
  • Try setting `-loglevel debug` and removing the `grep`. – wizzwizz4 Jul 10 '18 at 20:45
  • Thank you so much - I forgot about debug level. Here's what that outputs: https://pastebin.com/Rr12Sn1Y In the test I used, it had third frame repeats randomly throughout, and you can see where the filter dropped frames in debug. I think this will work! – Calculon Jul 10 '18 at 21:02
  • @Calculon Note that this is fuzzy matching; you'll need to set the high and low filter options accordingly if you want it to be exact matching. – wizzwizz4 Jul 10 '18 at 21:14
  • Yeah, even standard has worked pretty well for my purposes already, but I may tweak it. I am getting mixed files with random dupe frames I need to report and this is definitely finding them. – Calculon Jul 10 '18 at 21:35