Skip to content

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

Open

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

Activity

  1. sloev commented on Dec 14, 2025

    @sloev
    Author

    i have tried to use hap and other keyframe only codecs and have given up on the issue of the greenflash during looping on linux.

    i have previously used mpv player using openrndr to create the same software. so i tried using the https://github.com/PeteHaughie/ofxMPVPlayer/tree/main by davidemania and incorporated it into my software and it "JUST WORKS" so for now this is my fix.
    https://codeberg.org/supernihil/invasiv/src/branch/main/invasiv_app/src/ofxMPVPlayer.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions