get specific frame from m3u8 stream using opencv

asked 2017-08-04 14:15:36 -0600

dunika gravatar image

Hello!

I'm new to OpenCV and read that it handles streams, videos pretty well. I installed it on my raspberry pi and I'd like to know if I can solve this using OpenCV or are there easier ways? I would like to grab specific frames from a livestream webcam that has m3u8 extension.

My first try:

import cv2

VIDEO_URL = "http://stream.*playlist.m3u8"

cam = cv2.VideoCapture(VIDEO_URL)

total_frames = cam.get(1)

cam.set(1, 10) ret, frame = cam.read() cv2.imwrite('\home\pi\Desktop\codes', frame)

Thanks in advance.

edit retag flag offensive close merge delete

Comments

m3u is a playlist, a list of filenames, not a stream.

berak gravatar imageberak ( 2017-08-07 00:43:11 -0600 )edit