Comments (5)
Using the code in your OF forum post I can't recreate the problem (it works for me) - although you don't provide your header so I can't tell how you're setting up the array of ofxHapPlayers.
The movies all start playing when you call .play() (obviously) so maybe the second and third have finished by the time the first finishes?
from ofxhapplayer.
To answer your question though, you can't load a lot of movies at once - they each have video memory associated with them. I guess it might be useful to have a method to clear the texture resource but keep the movie loaded.
from ofxhapplayer.
Hi! Thanks for your answer.
The problem that I am facing is the following:
- Create an array, lets say of 10 positions, of ofxHapPlayer
- In setup, inside a for loop, load a clip in each position and play it (maybe that's the first mistake)
- In update, update only a portion of the clips in the array, let's say only the first one, becouse I want to play that clip first and once it is over, play the others
- In draw, draw that clip
- Loop 3) and 4) until first clip is over and then try to play the second clip
-> Then, that clip at [1] of the array is not available.
I thought that calling play do not totally play the clip, it has to be updated and drawn to play each frame.
The solution I am using is a dinamyc array of pointers. I can load a hundred clips and make different size vectors/arrays of pointers that play them. That works OK, I am playing around 40 clips at the same time from a pool of 100 clips. I am testing now to wait and call play only one the clip is going to be played, which looks like it will work, as suggested in that OF forum post.
In that case, why there is an play and update methods? Which is the propouse of two different method to play? Adapt it to OF idiosyncrasy?
In addition, when you call loadMovie, it looks like only part of the clip is loaded into memory and each time you call to update, another fraction is loaded. Only when you call close method, that memory is freed
from ofxhapplayer.
You misunderstand play()
and update()
.
play()
gives the command, once, to start playing, and immediately does so according to the loop, rate, etc settings. If one second later you ask for the current frame, you will get the frame one second into the movie.
update()
tells the player that if it needs to, it can do any internal work required to manage playback. Calling it or not is up to you - if you don't call it, then any work needed may be deferred until you perform other actions on the movie. It is good practice to call it in your ofApp::update()
function for every player, regardless of play/loaded state.
I'm going to close this issue because it sounds like things are working as they should, but continue to comment if you have any further questions.
from ofxhapplayer.
Thanks a lot Tom!
I would like to say that I am having amazing results using your
implementation of the HAP codec. I guess that by this time there is no
64bits version planned since QT is still 32bits, but that would be great.
I want to thank you your support and code. Is there any way I could promote
your coding? Unfortunatelly, there is no money I could use, but if you can
think of anything, let me know.
Best,
Diego
2015-02-11 11:30 GMT+01:00 Tom Butterworth [email protected]:
You misunderstand play() and update().
play() gives the command, once, to start playing, and immediately does so
according to the loop, rate, etc settings. If one second later you ask for
the current frame, you will get the frame one second into the movie.update() tells the player that if it needs to, it can do any internal
work required to manage playback. Calling it or not is up to you - if you
don't call it, then any work needed may be deferred until you perform other
actions on the movie. It is good practice to call it in your
ofApp::update() function for every player, regardless of play/loaded
state.I'm going to close this issue because it sounds like things are working as
they should, but continue to comment if you have any further questions.—
Reply to this email directly or view it on GitHub
#5 (comment)
.
from ofxhapplayer.
Related Issues (20)
- macOS 10.15 and OF 0.11 compile error HOT 8
- setFrame()? TODO HOT 1
- lower fps than ofxHAPAVPlayer with 10 x 4K
- Ringerbuffer clashes with ofxIO HOT 2
- INVALID OR CORRUPT FILE libavcodec.57.64.101.dylib HOT 4
- Exception from unique_lock in Demuxer.cpp HOT 5
- Sending video images to ofxCv HOT 1
- Libdispatch errors with GCC on some Linuxes HOT 4
- getTotalNumFrames() returns 0 HOT 4
- getWidth() and getHeight() return 0 HOT 2
- No PCM audio playback on OSX HOT 1
- Issue with multiple players HOT 6
- same video, asynchronous play
- Compiling on windows with qtcreator/msys2 HOT 1
- Error with @rpath/ffmpeg/lib/osx/libavutil.56.dylib
- Unable to pass ofxHapPlayer textures to a custom shader
- How to access Pixels still?
- It's possible to extract an image frame "offline" to generate thumbnails? HOT 1
- No sound on Windows...
- compatibility with ffmpeg 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ofxhapplayer.