Added mpdecimate option for ffmpeg. Drop duplicate frames when a video file is processed

For more info: https://ffmpeg.org/ffmpeg-filters.html#mpdecimate
This commit is contained in:
Rafael Moreno Lopez 2021-03-05 19:22:07 +01:00 committed by GitHub
commit 290d470a37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,8 @@ def extract_video(input_file, output_dir, output_ext=None, fps=None):
if output_ext == 'jpg': if output_ext == 'jpg':
kwargs.update ({'q:v':'2'}) #highest quality for jpg kwargs.update ({'q:v':'2'}) #highest quality for jpg
kwargs.update ({'vf':'mpdecimate'}) #drop duplicate frames
job = job.output( str (output_path / ('%5d.'+output_ext)), **kwargs ) job = job.output( str (output_path / ('%5d.'+output_ext)), **kwargs )
try: try: