Skip to content

[BUG] Last frame of media source flashes before starting video playback #2906

Description

@guusguusguus

Platform

Operating system and version: Windows 10, Pro 64-bit
OBS Studio version: 25.0.8

Expected Behavior

Play video starting with first frame

Current Behavior

First plays last frame and then starts playing from first frame

Steps to Reproduce

Add 'Media source'
Select a local video file (tested with quicktime and transparency and also h264 mp4) 
Configure playback with the following settings:
 [ ] loop
 [x]  restart playback when source becomes active
 [x] or [ ] use hardware enc..
 [ ] show noth...
 [x] or [ ] close file when in...

 Switch between scenes and the problem appears most of the time, problem is most consistent around lower framerates (25 fps) bu still noticeable around higher framerates (50 fps)

Additional information

I have a media source with a quicktime video with alpha enabled. When i start the scene with this media source it first shows the last frame of the video and then starts playing the video from the first frame. I have tested it with exporting the video with the last frame fully transparent and this solves the issue but it makes it impossible to end the video on the last frame.

i have also tested it without using transparency (a h264 mp4 file) and it has the same problem

problem persists on older versions (have tested it al the way back to version 16)

I have also been testing with framerates and the problem was most persistent with lower framerates (around 25 fps) and less persistent with higher framerates (around 50 fps) but the problem never really disappeared. the source material for the test was 25 fps

i started a post on the forum:
https://obsproject.com/forum/threads/last-frame-of-media-source-flashes-before-starting-video-playback.121882/

somebody confirms that the problem is also on the linux versions

i have been using the windows version (32 and 64 bit versions)

this is the output of the log file:

2020-05-10 00-55-14.txt

Activity

  1. changed the title [-]Last frame of media source flashes before starting video playback[/-] [+][BUG] Last frame of media source flashes before starting video playback[/+] on May 10, 2020
  2. RytoEX commented on May 10, 2020

    @RytoEX
    Member

    Please don't delete the issue template. Please edit your issue to use the template.

  3. therentabrain commented on May 19, 2020

    @therentabrain

    Workaround fwiw: I had this problem when going from one video file scene to another. I was able to avoid the flash by adding a full black screen jpg source under the first video. I also changed the first video from internal player to VLC. The second one is the internal player. I don't even remember what inspired this idea, or which one worked, but I hope something here helps.

  4. added
    issue/confirmed
    on Jun 10, 2020
  5. self-assigned this
    on Jun 10, 2020
  6. chamberlago commented on Jan 25, 2021

    @chamberlago

    I seem to be having this issue again with 26.1.1

  7. tdp4 commented on Apr 26, 2021

    @tdp4

    I can confirm this is also happening to me on 26.1.1.

  8. SimonGZ commented on Feb 25, 2022

    @SimonGZ

    Noting that this continues to be a problem in OBS 27.2.1 on Mac. This old forum post does a really nice job of visualizing the issue: https://obsproject.com/forum/threads/media-source-rendering-the-last-frame-at-the-beginning.110180/

  9. therentabrain commented on Mar 10, 2022

    @therentabrain

    I don't even understand my own workaround above.
    The one I use now is to put a very short black screen video file as the top item in the scene. When I switch to the scene, it plays the black frames on top and then that video stops, letting the thing underneath show through.

  10. DrewSunn commented on Sep 14, 2022

    @DrewSunn

    Problem persists on 28.0.1

  11. kimiastrid commented on Oct 21, 2023

    @kimiastrid

    Problem persists on 29.1.3
    It's really annoying.

  12. 1030 commented on Jan 31, 2025

    @1030

    Problem still persists in 2025. I have many projects halted due to this, any help would be appreciated. How do we escalate?

  13. therentabrain commented on Feb 2, 2025

    @therentabrain

    If I were still dealing with this, here's what I'd try as workaround now:
    use the Advanced Scene Switcher extension plugin
    Things I'd try...
    Macro 1:
    On scene change, reset all media players to no media (empty)

    Macro 2:
    On scene change, if the new scene is the one that should be playing media, then set the media source and immediately play it.

    If that doesn't work, then you could also put a cover image, or even a text box with a solid background, over the video and use Advanced Scene Switcher to turn it visible in macro 1, and hide it after 100 milliseconds or something in macro 2.

    And a third idea:
    Would it hide the trouble frame if you set up a 500ms fade-in as the "Show" transition for the video control? Then instead of having a cover-up object, you could tell Macro 2 to make the video itself appear, and perhaps the fade-in would hide the problem.

    Oh here's a variation:
    Do #3 using a very short blank solid video as a stinger. The advantage here is that it can pop in, rather than fade in, and the audio won't be affected. I think #3 might cause the audio to fade in.

    I haven't had to deal with this issue in a while but I thought these might be good ideas. :)

  14. kimiastrid commented on Feb 2, 2025

    @kimiastrid

    I'm still using 29.1.3 but now the problem seems to have resolved itself. :S Maybe the problem was with Windows, and after an update it started working normally. I don't know.

    On the stinger idea, I don't know if that would work, since a stinger is also just a cut with an overlay.
    If that doesn't work, maybe try a custom Luma Wipe (there's a way to add custom wipe PNGs, see here), but use a blank white image and set softness to 0. That will look like a cut with a small delay, but it should trigger the playout at the very beginning.

  15. SimonGZ commented on Feb 4, 2025

    @SimonGZ

    I'm on macOS with OBS 31.0.1 and the problem remains.

    I just tried some of @therentabrain's proposed workarounds (thank you for typing them out). Using Advanced Scene Switcher and setting it to blank out the file path and hide the scene item visibility, then restoring the scene item visibility and source settings does help but it's not a great solution for me. It removes the most obvious part of the painful flicker where you see the last frame of the media, but there's still a flicker as the video is now loaded in after a slightly longer delay. And of course there's now a lot of setup required in advanced scene switcher.

    Thinking through this problem, I think what's really desired here is that when returning to a scene with a media source set to restart after played (but not set to loop), OBS should have the first frame of the media source preloaded and ready to go, rather than the last frame or no frames.

  16. Poodmund commented on Feb 19, 2025

    @Poodmund

    I've had a bash at resolving this and it seems to be working in my debug build. I have absolutely no idea on the ramifications of what I've done however, so anyone who could review would be greatly appreciated: Poodmund@4986749.
    https://www.youtube.com/watch?v=gjyV74gqOFI

  17. kimiastrid commented on Mar 2, 2025

    @kimiastrid
  18. Poodmund commented on Mar 2, 2025

    @Poodmund

    In the pull request, it builds OBS with the changes. You can see the artifacts for all the different platforms in the Action checks; presuming you're using Windows, here is the link to the Windows one: https://github.com/obsproject/obs-studio/actions/runs/13485351192/artifacts/2637617428

  19. kimiastrid commented on Mar 2, 2025

    @kimiastrid
  20. Fenrirthviti commented on Mar 2, 2025

    @Fenrirthviti
    Member

    You need to be signed in to download artifacts.

    However, this issue is from 5 years ago and while there might be a similar problem, is likely something else since we already fixed the issue as presented in this case.

    Please keep discussion on the linked open issue #4667

  21. kimiastrid commented on Mar 5, 2025

    @kimiastrid

    You need to be signed in to download artifacts.

    However, this issue is from 5 years ago and while there might be a similar problem, is likely something else since we already fixed the issue as presented in this case.

    Please keep discussion on the linked open issue #4667

    Thank you! Silly me. I managed to download and install it. I'll post in the discussion you mentioned above if I find any problems.

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

Metadata

Metadata

Assignees

Labels

issue/confirmed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions