What is the best way to read frame from online streaming(using cv2.videocapture("sdp_file_name")) in every 5 secs from cv2.read ?

asked 2020-09-08 01:37:49 -0600

updated 2020-09-08 02:17:58 -0600

  1. I have used cap.set(cv2.CAP_PROP_POS_FRAMES, count) for skipping frames but this process is working fine with a video file, not with a camera and online stream
  2. I have used time.sleep(5), which works fine with a camera but not with online streaming

  3. right now I am using a counter for skipping frames in online streaming (is this the only efficient way to do it )

  4. I am looking for the best way to skip frames so I can reduce my computation while continuous reading of the frame
edit retag flag offensive close merge delete

Comments

i don't think, that you can read sdp files using VideoCapture

berak gravatar imageberak ( 2020-09-08 02:02:06 -0600 )edit

Hi, thanks for replying, no, I am able to do it from videocapture and i am getting data frames using " ret, frame = cap.read()" and I have tried all the above process for skipping frames

but what is the best way to read frame in every 5 secs(i want to reduce my computation by unnecessary use of cap.read() )

Warrior_KC gravatar imageWarrior_KC ( 2020-09-09 00:54:05 -0600 )edit