-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
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
Metadata
Metadata
Assignees
Labels
No labels
