openframeworks / openframeworks/openFrameworks
isFrameNew not working as expected on OSX.
Open
Nobody has claimed this yet.
section-video
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
On the master branch ...
Even when the update rate is set higher than the video fps, isFrameNew almost always returns true (sometimes it returns false upon looping).
#pragma once
#include "ofMain.h"
class ofApp: public ofBaseApp
{
public:
void setup()
{
ofSetFrameRate(60);
player.load("fingers.mov");
player.play();
player.setLoopState(OF_LOOP_NORMAL);
float fps = player.getTotalNumFrames() / player.getDuration();
std::cout << fps << std::endl;
}
void update()
{
player.update();
if (player.isFrameNew() == false)
{
cout << "Got same frame." << endl; // we should see this often ...
}
}
void draw()
{
ofDrawBitmapStringHighlight(ofToString(ofGetFrameRate()), 14, 14);
player.draw(0, 0);
}
ofVideoPlayer player;
};
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue in the shown ofApp update() loop on OSX, using ofVideoPlayer with a video whose FPS is below the application update rate. Trace how player.update() determines isFrameNew(), including behavior when looping. Done means isFrameNew() returns false when no new video frame is available and remains correct across loop boundaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100