Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Fix bug with video playback #445

Merged
merged 2 commits into from
Jun 24, 2024
Merged

FIX: Fix bug with video playback #445

merged 2 commits into from
Jun 24, 2024

Conversation

larsoner
Copy link
Member

@larsoner larsoner commented Mar 3, 2022

I used a 4k 30fps and 1080p 30 fps on Linux with:

import expyfun
fnames = ['hawaii_blue_water_4K.mp4', '342572022.mp4']
with expyfun.ExperimentController('test', full_screen=True, version='dev',
                                  session='a', participant='b',
                                  output_dir=None) as ec:
    ec.load_video(fnames[0])
    ec.video.set_scale('fit')
    ec.video.play()
    while not ec.video.finished:
        if ec.video.playing:
            fliptime = ec.flip()
        ec.check_force_quit()
    ec.delete_video()

On Linux, on main:

  1. With fnames[0] (4k) things are a slideshow (1-2 FPS) and I get the error reported in Unable to change window size for video playback #444
  2. With fnames[1] (1080p) things are smooth (probably the native 30 FPS) and there is no error

On this PR, for [0] I get the same playback but no error, and for [1] I get the same (good/correct) behavior as on main. And even when I set set_scale(0.1), playback is still terrible for the 4k video, suggesting that it's a video decoding/resolution limitation rather than anything having to do with the window/display size on screen (again, at least on my Linux machine!).

@JustinTFleming can you try this branch and see if you observe the same behavior on Windows? (BTW, with bug reports it's usually best to come up with a minimal reproducible example like the above if possible -- it saves devs time and makes sure that everyone is comparing apples to apples, to the extent possible!)

If you do get the same behavior, then I would look into maybe making your videos have a slower framerate or resolution.
Closes #444

@larsoner
Copy link
Member Author

Still seems to work okay a couple of years later and tests are green so in it goes!

@larsoner larsoner merged commit 8c67580 into LABSN:main Jun 24, 2024
9 checks passed
@larsoner larsoner deleted the video branch June 24, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to change window size for video playback
1 participant