You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Last frame of media source flashes before starting video playback #2906
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
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
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.
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.
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. :)
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.
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.
Hi! I'm having trouble building this. I followed the build instructions on
obsproject git, but after cmake --preset windows-x64 I get this:
Preset CMake variables:
ENABLE_BROWSER:BOOL="TRUE"
GPU_PRIORITY_VAL:STRING=""
RESTREAM_CLIENTID:STRING=""
RESTREAM_HASH:STRING=""
TWITCH_CLIENTID:STRING=""
TWITCH_HASH:STRING=""
VIRTUALCAM_GUID:STRING="A3FCE0F5-3493-419F-958A-ABA1250EC20B"
YOUTUBE_CLIENTID:STRING=""
YOUTUBE_CLIENTID_HASH:STRING=""
YOUTUBE_SECRET:STRING=""
YOUTUBE_SECRET_HASH:STRING=""
CMake Error at cmake/common/versionconfig.cmake:49 (list):
list index: 1 out of range (-1, 0)
Call Stack (most recent call first):
cmake/common/bootstrap.cmake:60 (include)
CMakeLists.txt:3 (include)
CMake Error at cmake/common/versionconfig.cmake:50 (list):
list index: 2 out of range (-1, 0)
Call Stack (most recent call first):
cmake/common/bootstrap.cmake:60 (include)
CMakeLists.txt:3 (include)
CMake Error at CMakeLists.txt:5 (project):
VERSION "bf92f0aea" format invalid.
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
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.
Activity
[-]Last frame of media source flashes before starting video playback[/-][+][BUG] Last frame of media source flashes before starting video playback[/+]RytoEX commentedon May 10, 2020
Please don't delete the issue template. Please edit your issue to use the template.
therentabrain commentedon May 19, 2020
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.
chamberlago commentedon Jan 25, 2021
I seem to be having this issue again with 26.1.1
tdp4 commentedon Apr 26, 2021
I can confirm this is also happening to me on 26.1.1.
SimonGZ commentedon Feb 25, 2022
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/
therentabrain commentedon Mar 10, 2022
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.
DrewSunn commentedon Sep 14, 2022
Problem persists on 28.0.1
kimiastrid commentedon Oct 21, 2023
Problem persists on 29.1.3
It's really annoying.
1030 commentedon Jan 31, 2025
Problem still persists in 2025. I have many projects halted due to this, any help would be appreciated. How do we escalate?
therentabrain commentedon Feb 2, 2025
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. :)
kimiastrid commentedon Feb 2, 2025
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.
SimonGZ commentedon Feb 4, 2025
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.
Poodmund commentedon Feb 19, 2025
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
obs-ffmpeg: Fix bug with last frame showing on video restart
kimiastrid commentedon Mar 2, 2025
Poodmund commentedon Mar 2, 2025
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
kimiastrid commentedon Mar 2, 2025
Fenrirthviti commentedon Mar 2, 2025
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
kimiastrid commentedon Mar 5, 2025
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.