Skip to content

obs-ffmpeg: Add pause visibility behaviour#6739

Open
mvji wants to merge 1 commit intoobsproject:masterfrom
mvji:media_src_vis_beh
Open

obs-ffmpeg: Add pause visibility behaviour#6739
mvji wants to merge 1 commit intoobsproject:masterfrom
mvji:media_src_vis_beh

Conversation

@mvji
Copy link
Contributor

@mvji mvji commented Jul 15, 2022

Description

Based on #6112

Add ability to pause local media src when source is not visible, and unpause when not visible
Use combobox like slideshow/vlc source visibility behaviour

Visibility

Use a similar UI code than PR #6239

Motivation and Context

Let user choose to pause a media when not visible
Another step to align media source features with other source.

How Has This Been Tested?

Mac os Intel 11.6.7

  • Check that the two mode of Restart playback..., is keep from a previous version of Obs
  • Check that modify checkbox "Restart playback...) (in not local file mode),
    or new combobox "Visibility Behaviour" (in local file mode), correctly update UI
  • Check that the three behaviour works as expected with a video file (even in loop mode)

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

based on PR 6112 by dcmouser

Replace for local file checkbox "restart playback..."
by a combobox with same mode than slideshow/vlc source
visibility behaviour
@mvji mvji force-pushed the media_src_vis_beh branch from 5fe1f87 to ad75656 Compare July 16, 2022 13:40
@RytoEX RytoEX added Enhancement Improvement to existing functionality New Feature New feature or plugin labels Jul 17, 2022
@dcmouser
Copy link

dcmouser commented Oct 6, 2022

I'm happy to support this modification over my older pull request with pause functionality.

@ghost
Copy link

ghost commented Oct 26, 2023

cherry-picked against the master and resolved the conflicts, compiled in Ubuntu 22.04 LTS, this feature is working well.

any reason this PR isn't merged yet?

the code I've tested is here

@Fenrirthviti
Copy link
Member

This needs testing against audio, video, and audio/video files, as well as remote content to ensure everything works appropriately. It hasn't been merged because the testing isn't complete, and it hasn't been a high priority for us.

@PatTheMav
Copy link
Member

There is a major issue with this PR (which might not be this PR's fault though):

  • The playback of the source does not happen synchronously with UI interaction but on a different thread
  • As such when interacting with the media source via the visibility switch, the playback is not immediately affected
  • When hiding a source, the media file continues to play for over a second
  • During that time a user can switch the source to be visible again, so playback continues
  • However this is not always correctly propagated to UI, so e.g. the source toolbar does not show any playback progress anymore (because it's under the impression that the source has stopped)
  • Same with pause/unpause: Because the pausing happens after some lag, it's not consistent (playback restarts from a different point in time than when it was paused)

By itself it all works as intended to a degree, but because of the way the media source is designed (and playback is handled) it introduces race conditions and unintuitive program states because of that.

@cab4444
Copy link

cab4444 commented Jan 5, 2026

@dcmouser & @mvji, is this something you're still able to work on/resolve issues for? Unless there is another way to do this as of 2026, I just want to have media sources stop(pause) playback when not visible and resume from the same spot without restarting from the beginning when visible again.

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

Labels

Enhancement Improvement to existing functionality New Feature New feature or plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants