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

UI: Add media controls widget #2380

Closed
wants to merge 1 commit into from

Conversation

cg2121
Copy link
Contributor

@cg2121 cg2121 commented Feb 6, 2020

Description

Adds a dock for controlling media/VLC sources. The dock is enabled by default, so users don't have to go dig for it.

Screenshot from 2020-02-06 05-28-49

Motivation and Context

Final piece of #1803

RFC: obsproject/rfcs#6

The media source playlist support in #1803, will be added at a different time to simplify this PR.

How Has This Been Tested?

Controlled different media sources.

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.

@dodgepong
Copy link
Member

dodgepong commented Feb 6, 2020

This is the part of the whole media controls PR that I think should still be up for debate. I'm not convinced a dock is the right way to go yet. I still think we should explore the source context menu from #1838/#1447, but I'd also like to hear other ideas too. If we add a new dock, I would want to see the removal of an existing dock (e.g. moving the buttons in the controls dock somewhere else, somehow).

@Fenrirthviti
Copy link
Member

Actually seeing this as a dock, I don't hate it as much as I thought I would. A big part of the reason that docks aren't ideal is that the default Qt docking system is a little limited in where/how you can place them. There's options for better docking systems that would make this less of an issue. Maybe this is a good push to finally explore implementing one of those? The big detriment to #1838 is that it's a static location, but I like everything else about it.

@dodgepong
Copy link
Member

So, at first glance I had assumed that media controls would appear in a list, similar to the audio mixer, where the control set for each media source would appear in a scrollable list in the dock, which I feared might get overwhelming with even a moderate number of media sources. Now on closer inspection I realize that you have to select a media source first before you can control it, and the controls that appear in the screenshot are updated to reflect the selected media source. I think that makes me dislike having a dock even more, because it's only relevant when a media source is selected, and is otherwise just taking up room.

While I do believe that having all media source controls for all media sources always visible is UI overkill, there are definitely usability advantages to at least giving users some controls without needing an extra click to select the media source first. Would it be crazy to have a play/pause button in the source list next to the Lock/Eye icons? This would at least match vMix's functionality, where one-click play/pause for video inputs is always available, but selecting the video input shows you more controls.

Lastly, would it be possible to add items to the context menu for play/pause/restart/next/previous? I'm not sure how much control sources have over customizing their context menus.

@WizardCM WizardCM added Enhancement Improvement to existing functionality Request for Comments More feedback & discussion is requested labels Feb 6, 2020
@COOLIGUAY
Copy link
Contributor

My point of view as a user if it is helpful.

Perhaps the ideal would be to have both options.

A dockable panel where you can see all the media and a context menu for the selected media
source.

(Photoshopped, although showing the controls in the menu and in the dock would be redundant...)
73933481-2623be80-48a2-11ea-9788-4c98c6ee6e56b

For those who use many multimedia sources in a scene, the same system as with the audio mixer could be used to be able to hide sources that they don't want to manage.

For example, if you have a background loop video and you are not interested in doing anything with it.

The advantage of being dockable is if the user needs to seek for a very specific point in a video, he/she can enlarge the dock (or undock) to accurate the search.

A streamer that only uses 3 scenes (starting soon, only cam and cam+game) can disable the dock, it will not be necessary for him/her.

For those who only use 1 video in a scene, with the source context menu would be enough.

But for those who use several videos in the same scene can be useful to have all of them in a dock.

The biggest use for me is to see the time left and the seeking bar.
For now, i think it would be a good start with a dock for controlling media.

I can not wait to see this amazing new feature in the final version!
Thank you!

@dodgepong
Copy link
Member

While a dock might not be a perfect solution, I can see the advantage of merging this now for the sake of at least having some sort of UI for media controls, especially now that the API has been added. Worst case, the user can disable the dock if they want, even if we add media controls somewhere else.

@ElectronicWar
Copy link
Collaborator

I am in favor of the dock solution as it is now. It feels natural in the current UI workflow.

@cg2121
Copy link
Contributor Author

cg2121 commented Feb 24, 2020

This has been edited to work with the source context menu PR (#1838). This will offer a better user experience than with a dock. Once that PR is merged, this will be finalized and also can be merged.

Screenshot from 2020-02-23 16-47-05

@cg2121 cg2121 changed the title UI: Add media controls dock UI: Add media controls widget Feb 24, 2020
@scaesare
Copy link

Thanks @briankendall, I can sometimes get the controls working with selecting the source media, but not always. Maybe a platform difference.

I do have separate media files I need to play back to back, so hopefully multiple media selection will get sorted out.

Thanks again.

@adamatos
Copy link

This is AWSOME!!!!

I too have had some small glitches where when cutting to and then from the controls won't respond.

One small suggestion. The ability to show time remaining ( or switch between the two) vs the current time would be ideal. Similar to a broadcast playback deck work that way you know exactly how much time you have left on the remaining clip at a quick glance

ui->slider->setValue((int)sliderPosition);

ui->timerLabel->setText(FormatSeconds((int)(time / 1000.0f)));
ui->durationLabel->setText(FormatSeconds((int)(duration / 1000.0f)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the requests we've been getting lately, I think people would rather see how much time is remaining in playback rather than the static duration of the media source, i.e. total duration minus time elapsed. A countdown time is important to see because people base manual cues off remaining time left in a media file, or do audible countdowns to other people on production. For example, they'll say things like "Camera 3 in 5...4...3...2...1...take" and base that countdown off the remaining time in playback.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually would think that a elapsed/remaining format would be useful. Some things cue off either...

@sinjun68
Copy link

Hello All! New member here. Thought I'd chime in. Downloaded Mac file from above.

#2380 (comment)

Running 10.14 Mojave on Mac.

Playback controls are present but don't actually seem to function. I can select any prerecorded video file from scene or source list and media counter seems inactive, none of the media controls function as well. The scrubber can be dragged but has no effect. Screenshot shows an active video file playing and shows the media controls active yet not functioning.

image

@scaesare
Copy link

So, having used this for a live event last weekend, I actually think two sets of media controls would be most useful for events requiring multiple media file playback: one for what's in preview, and one for the current program output.

I'd think a set of controls under each window (when in studio mode), much like what an NLE presents would be ideal.

@dodgepong
Copy link
Member

one for what's in preview, and one for the current program output

Multiple media files can be in a scene. It doesn't make sense to have one media control for a whole preview.

@scaesare
Copy link

one for what's in preview, and one for the current program output

Multiple media files can be in a scene. It doesn't make sense to have one media control for a whole preview.

It would seem to if I need to seek to the middle the next file I want to play.

Or perhaps I'm missing something, as in it's current state I can't get the controls to bind to anything other than the first file that starts playing. Is there a way to accomplish this with it's current architecture?

@dodgepong
Copy link
Member

The controls are supposed to bind to whatever media file is currently selected. If they aren't, that sounds like a bug.

@sinjun68
Copy link

The controls are supposed to bind to whatever media file is currently selected. If they aren't, that sounds like a bug.

Thanks! Yeah must be a bug. I've tried selecting the media files, renaming them, selecting from source and scene lists, and the controls are simply unresponsive.
Would love to see something like this implemented. The idea of monitoring the time signature of whats cued and whats playing would be great, being able to control their playback, even more so! Keep up the awesome work!

@scaesare
Copy link

The controls are supposed to bind to whatever media file is currently selected. If they aren't, that sounds like a bug.

Yeah I mentioned earlier that they aren't reliably doing that for me. If they were, would I be able to scrub through a file in review while the current one was playing in program?

@Fenrirthviti
Copy link
Member

Media sources are not active (and don't play because of that) while in the preview when in Studio Mode. This is not a bug, this is by design.

@dodgepong
Copy link
Member

dodgepong commented Apr 24, 2020

If they were, would I be able to scrub through a file in review while the current one was playing in program?

If they are the exact same source, I don't think so. I believe scrubbing in preview would also scrub the live instance of the source. You would have to have two separate sources each referencing the same file.

EDIT: Unless scrubbing the live view from the preview is what you wanted to happen, in which case yes, it would work.

@adamatos
Copy link

adamatos commented Apr 24, 2020 via email

@dodgepong
Copy link
Member

the timeline and countdown are useless when more then one media source is in a scene

I don't follow this at all. Can you explain more why this is the case? Why can't you just select the media file that you want to track?

@COOLIGUAY
Copy link
Contributor

I think they mean something like what I commented on here:

#2380 (comment)

@scaesare
Copy link

I think they mean something like what I commented on here:
#2380 (comment)

That looks like it would cover a lot of scenarios, mine included.

In my case I am cutting between pre-recorded content from multiple media sources and live content. So I need to:

-Start media file "A" at beginning. play until 30:00
-Cut to live scene at
-Cut back to media file "A", playing from 45:00 until 60:00
-Cut back to live scene
-Cut to media file "B" at some variable point (dependent on live scene)
-etc...

So being able to scrub thru cued up files in the preview window would be very useful

@xiCO2k
Copy link

xiCO2k commented Apr 25, 2020

@scaesare Yes that will really be a lot handy, I have to note here what minute a video ends to go live right after.

so this features will be really handy.

Thanks guys

@Pl1997
Copy link

Pl1997 commented Apr 26, 2020

Thanks a lot for your work @cg2121 ! This is a game changer feature for me. I can't wait for it to be merged.... I too think that the most versatile way of implementing it in the UI would be to integrate it as a dock (or even better, like suggested by @COOLIGUAY here #2380 (comment) ), but one way or another, it will be great to have this kind of functionality in OBS

@TALENTCRAZY
Copy link

Hi guys, I would like to test it but I can`t find the dock or the media controls panel in OBS 25.0.8.

How can I add your work to my OBS? I want to support you.

@iamareebjamal
Copy link

Read the comments above please

@dodgepong
Copy link
Member

Idea: This should also register hotkeys for controlling playback for the selected media source.

@redemotion85
Copy link

Hi, I would be very interested in this function in OBS, I tried the 25.0.3 release with the media controls but when I switch from one video to another I lose the reference track. I would also need only the countdown displayed below the video, can someone help me?

@xiCO2k
Copy link

xiCO2k commented May 3, 2020

@redemotion85 What I did was a Cue Audio with the same length as the video, with a 5 min warning, 1 min warning, 30 sec, 10, 5, 4, 3, 2, 1, and set it to Monitor Only. It does the trick for now ;)

@cg2121
Copy link
Contributor Author

cg2121 commented May 8, 2020

Moved to #2886, so both the media controls and source context menu can be tested.

@cg2121 cg2121 closed this May 8, 2020
@cg2121 cg2121 deleted the media-control-dock branch July 30, 2020 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement to existing functionality Request for Comments More feedback & discussion is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet