Skip to content

[0.12.1-linux] During loop video.getTexture() blanks green #8488

@sloev

Description

@sloev

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:

Image

video of bug:

Video Title

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions