Ask Your Question

OpenCV can't capture m3u8 video with videoCapture

asked 2013-09-25 16:41:16 -0500

bkennedy gravatar image

Hey Folks,

I'm trying to grab a live preview of a m3u8 video stream using OpenCV and Python on a Mac (OS X).

I've got a really simple test script here:

import cv2
stream = cv2.VideoCapture("")cv2.VideoCapture

That m3u8 stream is a working video that I can view through VLC no problem.

However when I run this all I get is: WARNING: Couldn't read movie file

Is it possible to run this in a debug mode and get more information? Anyone know if I'm likely to be missing an important library on OS X? Do I need to directly parse the datastream using Python? I was hoping the OpenCV did that for me.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-09-26 01:47:13 -0500

OpenCV uses Quick Time, AV Foundation and FFMPEG as a back-ends for video I/O. Please check, what back-end do you use? And check is this streaming protocol is supported by this back-end. You can rebuild OpenCV with another back-end using WITH_XXX properties of CMake.

edit flag offensive delete link more



Thanks for that info.

I read up on the cmake flags and tried to recompile but the make fails. Any thoughts on my steps below?

In OpenCV source dir

mkdir release

cd release


make -j8

This is the error it outputs

[ 24%] Built target opencv_video

[ 24%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_qt.cpp.o /Users/admin/Downloads/opencv- error: unknown type name 'Movie' Movie myMovie; // movie handle ^:

bkennedy gravatar imagebkennedy ( 2013-09-27 12:39:37 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2013-09-25 16:41:16 -0500

Seen: 1,910 times

Last updated: Sep 26 '13