HLS m3u8 HTTP live streaming video

Hi.
Does anyone know how to get an m3u8 (HLS) HTTP live stream working in OpenFrameworks?
I’ve tried tweaking the ‘videoPlayerExample’ but I get:

  
videoPlayerExampleDebug[13103:707] Error Loading Movie: Error Domain=NSOSStatusErrorDomain Code=-2149 "Not enough movie data is available." (notEnoughDataErr) UserInfo=0x3348ce0 {NSLocalizedDescription=Not enough movie data is available.}  
[ofQTKitPlayer:error] Loading file <URL>  

From what I can tell QTKit supports m3u8 but there’s not much out there in the way of help (I found this article, which is not promising: http://4pcbr.com/topic/a-story-about-hls-video-handling).

Any help much appreciated.
Thanks

Hello,

Did you have any success on this?

I’m trying to do the same thing—play an m3u8 (HLS) video inside oF—with no success so far. I’m on Osx 10.11.6, XCode Version 7.3.1, and oF 0.9.8.

Found this useful thread here but discussion stopped after AVF migration:
https://github.com/openframeworks/openFrameworks/issues/1844

Found this other thread here, more recent, that seems to suggest that m3u8 is currently supported by oF:

However, this didn’t work for me.

I tried a using a m3u8 link into videoplayer with no success:

//--------------------------------------------------------------
void ofApp::setup(){
	ofBackground(255,255,255);
	ofSetVerticalSync(true);
    fingerMovie.load("http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8")
	fingerMovie.play();
}

//--------------------------------------------------------------
void ofApp::update(){
    fingerMovie.update();
    
}

//--------------------------------------------------------------
void ofApp::draw(){
    if (!fingerMovie.isLoaded())
        return;
    
    ofSetHexColor(0xFFFFFF);
    
    fingerMovie.draw(0, 0, ofGetWidth(),ofGetHeight());
}

This code resulted in:

Replacing HTTP by HTTPS resulted in:

2017-04-07 12:12:19.062 HLSExampleDebug[31879:5856598] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9843)
2017-04-07 12:12:19.064 HLSExampleDebug[31879:5856566] track loaded with zero duration.

Am I missing something? Anyone would be able to provide any help/direction on this?

Any help would be appreciated.

Just as a reference, I’ve found these additional links related to the issue:

https://github.com/openframeworks/openFrameworks/issues/1741

https://github.com/openframeworks/openFrameworks/issues/5308

Decided to give ofGstVideoPlayer and ofxAvFoundationHLSPlayer a try.

Problem partially solved. I was able to play HLS m3u8 files using this:

However, this solution seems Mac only.

Haven’t given ofGstVideoPlayer a try yet. You might want to go in this direction if you’re on other platforms (i.e. Linux, and Windows). If you ever do so, please, let me know. I’d love to hear how that goes.

1 Like