I am processing a video using Opencv in python and using tqdm to show the progressbar. However, the progress goes beyond 100%. Not really sure why is this happening.
I am new to opencv ,so it is possible I am passing wrong params to do what I is intended.
I have tried out a few ways. Listing them down.
cam = cv2.VideoCapture("path")
fps = cam.get(cv2.CAP_PROP_FPS)
total_frame_count = int(cam.get(cv2.CAP_PROP_FRAME_COUNT))
length = total_frame_count/fps
pbar = tqdm(total = total_frame_count)
count = 0
while(True):
ret,frame = cam.read()
pbar.update(count)
# process(frame)
count += fps*5
cam.set(cv2.CAP_PROP_POS_FRAMES, count)
I have a counter called count which is basically to skip the video 5 secs.
from tqdm progressbar for opencv videocapture going beyong 100%
No comments:
Post a Comment