Activity › Forums › Adobe Premiere Pro › Removing duplicate frames
-
Removing duplicate frames
Posted by Steve Adams on December 23, 2018 at 1:18 amDoes anyone know a way to remove duplicate frames from a clip? I find that PP CC2017’s ‘s Optical Flow option for adjusting the speed of a clip will sometimes insert four or five identical frames. This may be due to something strange it found with the original clip. I don’t know. I’d just like to rip through the final clip and remove all frames that are exactly like the previous frame.
Thanks
Steve Adams replied 7 years, 6 months ago 3 Members · 6 Replies -
6 Replies
-
Kalleheikki Kannisto
December 23, 2018 at 9:13 amDon’t know of one that works directly in PPro, but some external options exist:
ffmpeg: https://www.ffmpeg.org/
PD Howler: https://www.thebest3d.com/howler/index.html
Old AE plugin Duplicate Frame Remover (officially CS4 compatible, but may work in CS6): https://aescripts.com/duplicate-frame-removerKalleheikki Kannisto
Senior Graphic Designer -
Bouke Vahl
December 23, 2018 at 9:33 amNot sure if it helps in this case, but I’ve used QTplayer (pro) to remove advanced pulldown.
If the clip start is the original one, an export with another speed will do the math and will perform removal of frames in a mathematical logic cadance.
YMMVBouke
http://www.videotoolshed.com -
Steve Adams
December 23, 2018 at 6:26 pmThanks. I looked at the first two but didn’t find anything about removing duplicates. Is it perhaps a filter? Could you maybe point me a little closer to the command that removes duplicates?
Thanks
-
Steve Adams
December 24, 2018 at 8:03 amThe frame rate is 24 fps. But I’m not dealing with a well-behaved clip, here, where something like a 3:2 pull down for the entire clip would do anything sensible. There are just parts of this clip where suddenly a frame is repeated 4 or 5 times and then it goes along fine for several seconds and the same thing will occur again. So it seems that what I need is something that decides when a frame is the same as the previous frame, and removes it – period. Fps doesn’t have much to do with it.
I’ve stepped through the clip manually with PP, frame by frame, and removed the duplicates and the result is what I want. I just don’t want to do it manually.
I found a Stack Overflow article on removing duplicate frames with ffmpeg at
https://stackoverflow.com/questions/37088517/ffmpeg-remove-sequentially-duplicate-frames .
This suggests that something like
ffmpeg -i in.mkv -vf mpdecimate out.mkv
ffmpeg -i in.mkv -vf decimate=cycle=6,setpts=N/25/TB out.mkvmight work, though I’m not sure yet what the various parameters mean.
-
Bouke Vahl
December 24, 2018 at 10:34 amA few hints when you are going to toy with FFmpeg (which is great fun btw.)
First, the terminal supports drag and drop, and copy / paster. You want that, as spaces and other characters have to be escaped, and when you drop FFmpeg and your video file onto the terminal, that will be taken care of.
For the output file, create a dummy file in the output folder, drop that and have FFmpeg overwrite.
Now, you’ve got the basics, but you are missing a good output codec.
If you want prores, use -c:v prores -profile:v 2
-c:v meand Codec Video
Profile can be 0 up to 3, where 0 is proxy and 3 is HQFFmpeg is case sensistive sometimes, be aware.
To test, use ffmpeg -ss 30 -i input -t 10
-ss means search 30 seconds into the video to start, -t 10 means process only 10 seconds.
This is great to fiddle around without having to way too long.Also, you can add -an to the command line (audio: none) so your output has no sound. |
Have fun toying!
Bouke
http://www.videotoolshed.com -
Steve Adams
January 2, 2019 at 5:29 pmI just wanted to post a follow up. I dug through ffmpeg and I was able to remove my duplicate frames. The final command was:
ffmpeg -i cut.mp4 -vf mpdecimate,setpts=N/24/TB -vsync vfr cut_p.mp4
I ran into two problems along the way:
1. MP4, by default, is a constant frame-rate muxer in ffmpeg, so timestamp gaps created by mpdecimate removing duplicates will be plugged back in by duplicate frames. The solution is to set variable frame-rate mode with -vsync vfr.
2. I had to retime the frames after removing the duplicates to get them to play at 24fps, using setpts=N/24/TB.
Thanks
Reply to this Discussion! Login or Sign Up