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: obs-ffmpeg/libobs: Media Source flashes its previous last frame when restarted on activation (upstream #4667) #249
libobs/obs-source.c:3600: obs_source_output_video(source, NULL) clears the frame queue but leaves the async textures holding the old picture. The next queued frame sets async_active again at once, but only reaches the textures when it is rendered (libobs/obs-source.c:2551). A render that falls in between draws the old picture (libobs/obs-source.c:2600).
Class
Visual glitch: a stale frame is shown on screen and in recordings and streams.
How it is reached
A Media Source with "Restart playback when source becomes active" on (the default) and "Show nothing when playback ends" off plays to the end and keeps its last frame. The scene is switched away and back. For one or two output frames the source shows the previous playback's last frame, then plays from the start. It is most visible when the first and last frames differ, for example an animated overlay. Upstream confirmations from 26.x to 32.x, on Windows and macOS among others (SimonGZ, CSMBY, parish-of-brentford, codemann8, VirtuallyJesse, DrewSunn, RoyceRemix, contentfree, SpokeLee).
Reproduced with the real ffmpeg_source and a generated clip: after switching back, the output goes nothing, LAST frame, first frame.
Proposed fix and failing test
Fix, two halves, each needed (either alone still shows the old frame for one output frame):
libobs marks the async textures stale when a source is cleared and skips drawing them until a new frame is uploaded or a preloaded frame is shown.
RED test (cmocka, test_media_restart_stale_frame): the Media Source scenario above, plus a scripted async source that clears and then queues or preloads a frame on known ticks. 3 of 5 fail today; the two guards (a clear still clears, a preloaded frame shows on the next tick) pass.
RED: test_media_restart_stale_frame (3 of 5 failing): the real ffmpeg_source restarting on activation, plus a scripted async source that clears and then queues or preloads a frame.
GREEN: ffmpeg_source_activate() clears the source before queueing the restart, and libobs stops drawing async textures that a clear made stale.
PR today.
Cause: when a Media Source restarted on activation, the restart only ran on the next video tick, and clearing the source left the old picture in its textures, so the first output frames after switching back showed the previous playback's last frame. Now the source is cleared before the restart is queued (the activation half of Poodmund's upstream PR obsproject/obs-studio#11881, credited as co-author), and libobs no longer draws textures that a clear made stale. The test plays a clip through the real Media Source and switches scenes away and back: before, the output went nothing, last frame, first frame; now it goes straight to the first frame.
Not covered: sources with deinterlacing enabled still use a separate render path that can show the old frame.
obs-rust is an AI-assisted fork of OBS; on Arch it's obs-studio-rust-git in the AUR.
If you try it, a short reply here on whether the flash is gone would really help.
Activity
rdoupe commentedon Oct 11, 2026
Claiming: this issue.
test_media_restart_stale_frame(3 of 5 failing): the realffmpeg_sourcerestarting on activation, plus a scripted async source that clears and then queues or preloads a frame.ffmpeg_source_activate()clears the source before queueing the restart, and libobs stops drawing async textures that a clear made stale.PR today.
libobs, obs-ffmpeg: Do not flash a Media Source's old frame on restart
test: Media Source must not flash its last frame when restarted on ac…
rdoupe commentedon Oct 11, 2026
@mercantigo you reported this in obsproject/obs-studio#4667, so a heads-up: it's fixed here in obs-rust by #250, merged today with a regression test.
Cause: when a Media Source restarted on activation, the restart only ran on the next video tick, and clearing the source left the old picture in its textures, so the first output frames after switching back showed the previous playback's last frame. Now the source is cleared before the restart is queued (the activation half of Poodmund's upstream PR obsproject/obs-studio#11881, credited as co-author), and libobs no longer draws textures that a clear made stale. The test plays a clip through the real Media Source and switches scenes away and back: before, the output went nothing, last frame, first frame; now it goes straight to the first frame.
Not covered: sources with deinterlacing enabled still use a separate render path that can show the old frame.
obs-rust is an AI-assisted fork of OBS; on Arch it's
obs-studio-rust-gitin the AUR.If you try it, a short reply here on whether the flash is gone would really help.