openframeworks / openframeworks/openFrameworks
[0.12.1-linux] During loop video.getTexture() blanks green
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
problem:
i am trying to get a video player to loop properly in openframeworks but i get ocational blanking on the point where it loops.
image of bug:
video of bug:
relevant code:
class VideoContent : public Content
{
private:
ofVideoPlayer video;
ofTexture tex;
public:
void setup(string filename)
{
if (ofFile(filename, ofFile::Reference).exists())
{
ofLogNotice("VideoContent") << "Loading video: " << filename;
// OPTIMIZATION: Use RGBA to avoid heavy CPU YUV->RGB conversion
video.setPixelFormat(OF_PIXELS_RGBA);
video.load(filename);
video.setLoopState(OF_LOOP_NORMAL);
video.play();
}
else
{
ofLogNotice("VideoContent") << "Error: " << filename << " doesnt exist!";
}
}
void start() override
{
// if (!video.isPlaying())
// {
video.play();
// }
}
void stop() override
{
// if (video.isPlaying())
// video.setPaused(true);
}
void update() override
{
video.update();
if (video.isFrameNew())
{
tex = video.getTexture();
}
}
ofTexture getTexture() override
{
if (tex.isAllocated())
{
return tex;
}
else
{
return TestTexture::getInstance().getTexture();
}
}
};
source: https://codeberg.org/supernihil/invasiv/src/branch/main/invasiv_app/src/WarpController.h#L60
here is my complete setup:
https://codeberg.org/supernihil/invasiv
i am building in a docker container (https://codeberg.org/supernihil/invasiv/src/branch/main/Dockerfile)
with all dependencies locked down to git hashes
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 loop in the linked WarpController.h code, using the pinned dependencies and build setup in Dockerfile. Trace ofVideoPlayer.update(), isFrameNew(), and getTexture() at the loop boundary; done means the video texture no longer blanks green during looping on Linux.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100
