AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Video file duplicate finder11/19/2023 Print("Time taken for ", file_full_path, " is : ", time_taken) Height = int(VideoCapture.get(video_pointer, int(CAP_PROP_FRAME_HEIGHT)))įps = int(VideoCapture.get(video_pointer, int(CAP_PROP_FPS)))įrame_hash = average_hash(omarray(image)) Width = int(VideoCapture.get(video_pointer, int(CAP_PROP_FRAME_WIDTH))) Video_pointer = VideoCapture(file_full_path)įrame_count = int(VideoCapture.get(video_pointer, int(CAP_PROP_FRAME_COUNT))) With open(file_full_path, 'w') as file_pointer:įile_full_path = input_vid_dir + filename Json_dir = r'C:\Users\gokul\Documents\db\\'Īnalyzed_dir = r'C:\Users\gokul\Documents\analyzed\\'ĭuplicate_dir = r'C:\Users\gokul\Documents\duplicate\\'įile_full_path = json_dir + filename + ".json" Input_vid_dir = r'C:\Users\gokul\Documents\data\\' from os import path, walk, makedirs, renameįrom cv2 import VideoCapture, CAP_PROP_FRAME_COUNT, CAP_PROP_FRAME_WIDTH, CAP_PROP_FRAME_HEIGHT, CAP_PROP_FPSįrom multiprocessing import Pool, cpu_count You can just change the directories at the top and you are good to go. The problem is that I had videos of various formats and resolution, so I needed to take a hash of each video frame and compare. I too had the same problem, so I wrote a program. I found a great working answer to my question can you allow me to answer it? To the human eye this would be exactly the same, so I am seeing duplicates, but I don't want to have to watch and compare 16,000+ video clips all on my own. mp4 files? On average they are about 30 seconds each, however its only a few milliseconds difference when compared closely to another. mp4 files.ĭoes anyone know how I might find success in finding duplicates of these short video clip. This causes them to be different and not identical, resulting in any duplicate finder using "byte for byte comparison" result no duplicate results.Īnd although the majority of the video clip is exactly like several others, nothing I use is finding any duplicates because of the few milliseconds difference at the beginning or at the end of the compared. But no! The reason why not is because there may be a slight extra (or non-extra) few milliseconds in the beginning or end of the video clips. You would think that comparing exact byte size would be good enough since bytes are so small. I have already tried several methods and had zero success in finding duplicates. I have 16,000+ short video clips and there are lots of them that are exactly alike to the human eye, but if you examine very closely you will find that one or the other may have an extra 1 second (or much much less) duration at the beginning or the end.
0 Comments
Read More
Leave a Reply. |