Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLS m3u8 HTTP live streaming video #1844

Closed
philworthy opened this issue Jan 30, 2013 · 15 comments
Closed

HLS m3u8 HTTP live streaming video #1844

philworthy opened this issue Jan 30, 2013 · 15 comments

Comments

@philworthy
Copy link

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 (which I'm assuming is the guts under the OF video player) 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).

There's also an existing thread on this here:
#897
But it seems to have gone dead a long time ago so posting again incase anyone's listening...

Any help much appreciated.
Thanks

@bakercp
Copy link
Member

bakercp commented Jan 30, 2013

Here's a link folks can use for testing:

http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8

As for the answer to your question, I'm not sure yet ...

@philworthy
Copy link
Author

Thanks @bakercp - that's a useful link.
Let me know if you figure it out :)

@bakercp
Copy link
Member

bakercp commented Jan 30, 2013

Well, it's not immediately working with the QTKit player, but something is happening ...

I am using the osxHighPerformanceVideoPlayerExample.

I am using:

http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8

instead of fingers.mov.

This is a single stream playlist (with all *.ts files listed), not a multi-resolution playlist.

It correctly lists the total length of the video (i.e. 30:01 or 1801 seconds).

The time seems to move forward appropriately ... but the framecount is funky and the frames move very slowly (and aren't visible).

Deep inside ofQTKitMovieRenderer.m I'm wondering if NSMutableDictionary* movieAttributes is being set in a compatible way when the QTMovie alloc is happening. (I'm comparing it to this http://stackoverflow.com/questions/11321288/playing-hls-m3u8-using-qtkit-in-macos-10-6-8).

Perhaps this isn't working out of the box due to the fancy threaded work used for async frame access w/in qtkit? @obviousjim - thoughts?

P.S. the m3u8 link above works in VLC and Quicktime 10.x but fails (as @ofTheo noted) on Quicktime Player 7.x.

@philworthy
Copy link
Author

I found this article fromApple describing how AV Foundation supersedes QTKit as the framework of choice for time based media. (OS 10.7 onwards):
http://developer.apple.com/library/mac/#technotes/tn2300/_index.html
Coudl it be simply that QTKit doesn't support HTTP live streaming?... so I looked around for an AV Foundation based player and it looks like there's on in the iPhoneVideoPlayer in OF already.
You know if that's an option for this problem?
I haven't had a chance to try yet.

Some links for reference:
http://forum.openframeworks.cc/index.php/topic,11497.0.html
https://github.com/openframeworks/openFrameworks/blob/master/addons/ofxiPhone/src/video/AVFoundationVideoPlayer.h
http://www.julapy.com/blog/2012/07/03/ofiphonevideoplayer-avfoundationvideoplayer/

@bakercp
Copy link
Member

bakercp commented Jan 30, 2013

I'm pretty sure that QTKit does support it in some capacity, but we may not be implementing it in such a way that works out of the box.

@obviousjim (and someone else whose name is escaping me ... apologies) is a master of this domain and has plans to move everything to to AVFoundation soon, but that effectively requires dropping "legacy" support for OS X (i.e. it requires 10.7+).

@obviousjim
Copy link
Contributor

@_vade and I are looking into creating an AVFoundation video player for oF that could address this, but it will be 10.8 only most likely as the API for many features needed in the current player are only available on that OS.

@philworthy
Copy link
Author

I agree @bakercp it seems weird that QTKit can't handle http streams - These were about way before 10.8... but that's promising news @obviousjim, thanks! I'll be eagerly waiting for that for sure :)
I guess I'll have a tinker with iPhoneVideoPlayer in the meantime.
Thanks!

@bakercp
Copy link
Member

bakercp commented Jan 30, 2013

I believe there is room to tinker with the ofQTKitVideoPlayer as well -- it seems like it is almost working -- but unfortunately I am not able to dig into it at the moment.

@philworthy
Copy link
Author

I'm a bit of a noob with c++ so might be above my pay-grade (for now), but I'll certainly give it a go.
Looks like @julapy is looking into this too (on the iPhone AV Foundation player)
#1741

@bilderbuchi
Copy link
Member

@philworthy: just for reference, if you find a problem which is already described in a bug report (even a closed one, it can be reopened), continue the discussion there instead of opening a new one, cause that unnecessarily fragments the discussion (also, the same or larger amount of people see it if it's a post in an old issue, compared to a new one)

@bilderbuchi
Copy link
Member

On second thought, I'm closing this as a duplicate of #897, please continue the discussion overe there. :-)

@ofTheo
Copy link
Member

ofTheo commented Jan 30, 2013

well - technically one is about ofQuicktimePlayer and the other is ofQTKitVideoPlayer
:)

It might be better to keep this one open - only because its more likely ofQTKitVideoPlayer will be able to support m3u8 than the legacy ofQuicktimePlayer.

I'm going to close the other one as I don't think ofQuicktimePlayer will ever support m3u8 and re-open this one.

@ofTheo ofTheo reopened this Jan 30, 2013
@ofTheo
Copy link
Member

ofTheo commented Jan 30, 2013

seems possible with QTKit ( link @bakercp posted )
looking at the code - it seems very doable.
http://stackoverflow.com/questions/11321288/playing-hls-m3u8-using-qtkit-in-macos-10-6-8

@philworthy
Copy link
Author

Sorry for the cross post @bilderbuchi... but good news about QTKit @ofTheo - were you able to get it to play?
The more I read the clearer it becomes that Apple is moving everything to AV Foundation, but if QTKit will do it then that's awesome (and it'll work on older OSs).

@kylemcdonald
Copy link
Contributor

Because QTKit and QuickTime are deprecated by Apple as of 10.9, we are focusing on AVF. Follow #2283 for developments. Remaining QTKit and QuickTime-specific issues will be closed with wont-fix, but bugfix PRs will be accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants