openframeworks / openframeworks/openFrameworks

ofVideoPlayer makes the app not responding after a while if (especially large) video file are reloaded.

Open
#2,530 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug close core macOS section-video
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

app stalls/blocks and osx multicolor wheel starts rotating after a while if movie files are (re)loaded.
The problem happens with frequent reloading (every 2 or 3 update calls or after played 2 or 3 frames checking getCurrentFrame) and sooner with large video file (2 GB). This happens to me after few seconds or several minutes depending on video size and reloading frequency. Note that this makes the app blocking faster, but i experienced this problem even with loading a clip on a movie loop video with a sensor input (i.e. randomly).
A small video file (50 MB) blocks the app if loaded after few update (reloadUpdate=2 in the example below), just after the previous one ( if myMovie.isLoaded(){load another one} ) or after the movie is loaded and played a bit (a couple of frames, reloadAfterFrame=2)
A big video file loading blocks the app sooner even with not so fast reloading frequency (i.e. reloadUpdate=20 or reloadAfterFrame=20).
Also when the app freezes the memory allocated (in the activity monitor report) doubles (it's not releasing the previous movie? anyway even if i close the movie before loading a new one things don't change).
I start experiencing this problem with version 0072, now i'm using v008, v0071 works fine to me.
osx 10.8.1 on mac mini 2,3 Ghz Core i5, solid state hd.
Quiktime Photojpg codec.

void testApp::setup(){
    ofSetVerticalSync(true);
    currMovie=0;
    myMovie.loadMovie(ofToString(currMovie)+".mov");
    myMovie.play();
    changeMovie=0;

    reloadUpdate=20;// =2 this blocks sooner the app
    reloadAfterFrame=20;// =2 this blocks sooner the app
}

//--------------------------------------------------------------
void testApp::update(){
    changeMovie++;
    if (changeMovie>reloadUpdate)
   // if (myMovie.isLoaded() && myMovie.getCurrentFrame()> reloadAfterFrame) 
    // checked also if movie was loaded and played some frames, same result
    {
        cout <<"reload "<<ofToString(currMovie)<<".mov"<<endl;
        changeMovie=0;
        currMovie++;
        currMovie=currMovie%3;
        myMovie.loadMovie(ofToString(currMovie)+".mov");
        myMovie.play();
    }
    myMovie.update();

}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the ofVideoPlayer loadMovie/update entry points and reproduce the issue using the setup() and update() example with repeated reloads of the three movie files. Compare behavior across the reported openFrameworks versions on macOS. Done means repeated reloading no longer stalls the app or causes the reported memory growth.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.