Ask Your Question
0

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:

#!/usr/bin/python
import cv2
stream = cv2.VideoCapture("http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8")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 http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8

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
0

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

Comments

1

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

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON -D WITH_QUICKTIME=ON -D WITH_FFMPEG=ON -D WITH_AVFOUNDATION=ON ..

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-2.4.6.1/modules/highgui/src/cap_qt.cpp:75:5: 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

Stats

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

Seen: 2,370 times

Last updated: Sep 26 '13