ofVideoPlayer.load and .loadMovie problems when streaming

I am experiencing a weird problem when trying to load a stream video.
I am using this youtube link:


Using v0.8.4 and video.loadMovie(link) works OK but v0.9.0 video.load(link) throws this error:

assetReader: error during initialisation: Operation Stopped
problem with creating asset reader.

Any idea?
Thanks a lot!

which platform is this on? windows, osx, linux?

Hi Dom!
Thanks for answering. Sorry, I missed that piece of info, quite relevant.
I am using osx 10.11. I had to change Deployment Target under XCode to something greater than 10.6 -that was the first error that I had-
After that, I had the errors I printed in the first post.

Thanks a lot!

Attending to this:
Looks like you need to call specific constructor when using a URL:

If you simply want to play a live stream, you can take a shortcut and create a player directly using the URL use the following code:

self.player = [AVPlayer playerWithURL:<#Live stream URL#>];
[player addObserver:self forKeyPath:@“status” options:0 context:&PlayerStatusContext];
Is this built on OFv0.9? I have checked the ofAVFoundationVideoPlayer.h file and there is a reference to loadWithURL and looking the .m makes me think about the Option passed, but that starts to get fuzzy for my -lack of-knowledge :frowning:

Load from URL is built in. check here:

or here:

both have options for streaming

Thanks Dom!
I will give it a try tomorrow morning together with the async load! I will let you know.

I just can not make it work :frowning:
videoPlayer of AVFoundation is protected…
I am using the version from Download insteadof github, may that be the issue?
Also, I can’t use ofAVFoundationVideoPlayer but ofAVFoundationPlayer.
Have you tried the link I gave in the first post with a ofVideoPlayer object and it .load() method?

So, another try!
This is what I have tested:
I used youtube-dl to get the link to the last Star Wars trailer -my first link is not working anymore, I have noticed it is IP dependent-

youtube-dl -g https://www.youtube.com/watch?v=sGbxmsDFVnE

So I have the actual link

Then, I use this code:

string link = “{the_link_youtube-dl_gave}”;
ofVideoPlayer player;

Right after .load(), I have this error:

2015-12-09 15:44:25.073 videoTestDebug[1236:765100] assetReader: error during initialisation: Operation Stopped
2015-12-09 15:44:25.074 videoTestDebug[1236:765100] problem with creating asset reader.

Can anybody replicate this code with OF v0.9.0? Using that link or any other, I am open to any suggestion. I just can’t find where the problem is.
I had no problem with loadVideo() in 0.8, but I want to use asynch load. I can use the AVFoundation add on

Hi again!
I am also having problems with the v0.8.4 code depending on my XCode version and OSX version. I am opening an issue in github.
I will come back when I have more news!

Hi again!
No luck so far :frowning: I posted an issue in github, but I am finding this terrible difficult. Has anybody tried loading a URL with v0.9.0?

i tried your code on OF 0.8.4, OS X 10.10 and Xcode 6.4 and it works fine.
the same code on OF 0.9.0 does throw this error message. But i don’t know why.

[09:51:59.845] FigLimitedDiskCacheProvider_CopyProperty signalled err=-12784 (kFigBaseObjectError_PropertyNotFound) (no such property) at /SourceCache/CoreMedia/CoreMedia-1562.240/Prototypes/FigByteStreamPrototypes/FigLimitedDiskCacheProvider.c line 947 2015-12-21 09:51:59.849 testVideo8[1830:112822] assetReader: error during initialisation: Operation Stopped 2015-12-21 09:51:59.849 testVideo8[1830:112822] problem with creating asset reader.

Thanks buddy. Now at least I know is not my fault…
Let’s hope some one can throw some light…
Arturo suggested it may have to do with the delay time from opening until the stream is properly ready… but I have no clue how to chek it…

I tried a youtube link and a video hosted on a local server, but I get the same error as you. I hope someone can shine a light on this :confused:

Thanks a lot for giving it a try.
I posted an issue in github. Maybe you could insist in there?
Thanks again!

I found this:
but I don’t know how to continue :frowning:
Also, there are two different implementation of AVFoundation player: AVFoundationPlayer and AVFoundationVideoPlayer
Does anybody know the difference?

Hi again and happy new year!
I have found no solution yet. Neither github issue seems to be answered. Anybody has any clue?

No news, bad news?

@dmelladom in 0.9.0 we switched to a new video player api since the old one is being deprecated by apple. Some things like streaming might have not been implemented yet so this needs to be implemented. It’s not a simple fix and someone has to find the time to work on it. Also the issue in github is milestoned for 0.10 and we are working right now on releasing 0.9.1 so it probably won’t happen at least until after 0.9.1 is ready.

If you or someone else want to look into it, a pull request with the implementation or any clue in the issue about what needs to be done for this to work would be really helpful.

Hi arturo,
I totally understand the situation. I won’t insist any further. I did not noticed it was milestone for 0.10, sorry for that.
I am more than pleased to help, but I am not sure where to begin. If somebody could provide a direction on the topic, I will start researching from there. At the point where the new video api begins, the code get too obscure for me.
Thanks a lot for your support and help with all these, I really appreciate it.

maybe start here:

as a starter maybe try to make your own addon with an objective-c wrapper that allows you to get videos via the OS X AVFoundation and AVKit.

i recently needed to get the location IDs from connected cameras and didn’t see away for ofVideoGrabber to supply that.
So pull some code out of the base OF code and combined it with some object-c code. it’s quite a hack but it works.