FrancescoCeruti / linux-show-player

Linux Show Player - Cue player designed for stage productions
https://linux-show-player.org
GNU General Public License v3.0
207 stars 49 forks source link

Video playback/Run Command cues #3

Open nodiscc opened 9 years ago

nodiscc commented 9 years ago

Hi, thanks for writing this great tool. Are there any plans to support video cues? I see you are already using GStreamer which is able to do video decoding. Video playback in a separate window (e.g. placed on an external monitor/videoprojector) would be a nice addition.

FrancescoCeruti commented 9 years ago

Hi, yes, I've plans to support video cues, probably it will take quite a bit because currently I'm working on a better software design and some new functionality for the 0.4 version, but the plan is to add the video support as soon as possible after this release.

gnaag commented 8 years ago

Looking forward to this. Currently there is no video show manager on linux (vlc and split playlist not counting because it is really clumsy to use during the show). Thanks in advance.

nodiscc commented 8 years ago

Another way around would be adding cues with the abiity to run arbitrary commands (eg vlc /path/to/scene1.mpg). This would also be useful for interfacing with other programs that don't support MIDI IN/Jack transport, etc.

This way you leave video playback/decoding/filters to a full featured video player.

FrancescoCeruti commented 8 years ago

@nodiscc good idea

gnaag commented 8 years ago

That would bring even more possiblities such as displaying webpages in a browser directly from cues or showing off applications. Nevertheless built-in videoplayer would be a bit better for end-users.

2016-04-28 22:53 GMT+02:00 Francesco Ceruti notifications@github.com:

@nodiscc https://github.com/nodiscc good idea

  • Video Playback
  • Run command cues

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/FrancescoCeruti/linux-show-player/issues/3#issuecomment-215557958

nodiscc commented 8 years ago

@gnaag a need will inevitably arise for users to apply some filters/seek/do whatever an advanced player already does, which is what I suggesting leveraging this, instead of eating development time (do not reinvent the wheel)

gnaag commented 8 years ago

The question is whether it would be responsive enough. During show it is necessary to click and run.

2016-05-04 21:02 GMT+02:00 nodiscc notifications@github.com:

@gnaag https://github.com/gnaag a need will inevitably arise for users to apply some filters/seek/do whatever an advanced player already does, which is what I suggesting leveraging this, instead of eating development time (do not reinvent the wheel)

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/FrancescoCeruti/linux-show-player/issues/3#issuecomment-216968053

nodiscc commented 8 years ago

Ah I see what you mean (lag due to time required to launch the player). Regarding VLC specifically, if you set it to "only allow one window" it will start playback in an existing VLC window (very fast):

Some other players are fast enough (mpv/mplayer) but I have no experience with "use existing window" with those.

FrancescoCeruti commented 8 years ago

Well, since the "command-cues" are just a bunch of lines of code, I've implemented them, so someone che use them to play videos ... and to do other awesome things ;)

Anyway I've received more than one request for proper video-cues, and I think that having all you need in one piece of software, sometimes, is more simple than combining more tools, plus, the big work is to refactor the current code to allow video and audio streams, all the inputs/output and effects are almost only wrappers around GStreamer elements.

nodiscc commented 8 years ago

Nice, will test this soon.

having all you need in one piece of software, sometimes, is more simple than combining more tools

Right.

... and to do other awesome things ;)

Looking forward to test this with lighting cues and puredata commands. Thanks!

macdroid53 commented 8 years ago

This feature is definitely desirable. Might be able to implement it with info-beamer...and it has a raspberry pi version. Multiple video displays could be commanded over the net with OSC or MIDI commands from LISP. https://info-beamer.com/

offtools commented 7 years ago

Mapmap is also a possibity. Its still under development but under Linux sound works since some weeks and it has OSC support, which gives some more control options then their gui. And it is the only working mapping software under Linux I know so far I know.

Its possible to use command cues and "oscsend" to control mapmap. Mapmap still has some glitches (videos are only looped at the moment...), but not a big deal.

A native support for mapmap through a module in lisp would be awesome.

fnetX commented 5 years ago

Hey, I just wanted to refer to this for video cue: https://github.com/FrancescoCeruti/linux-show-player/issues/166#issuecomment-478291399

mpv is only a workaround, but it works really well. The feature set is really good, it supports many formats, is really customizable. I know it's probably not a good idea to depend on third party software, but for everyone who's searching for a workaround: I think it's perfect. You can even disable every OSD stuff in case you accidentally toggle it.

Edit: and I think that mapgen is not exactly suited for simply putting things on screen. There should be something easier (like mpv is).

Edit 2: I'll just share some of my mpv codes I use. Might be someone is looking for an urgent workaround:

run mpv on second screen: mpv --fs --fs-scren=1 FILE.mp4

run mpv and disable OSD: mpv --no-osc 1 --osd-font-size=1

run mpv on second screen with subtitles and some options: mpv --fs --fs-screen=1 --sub-file=FILE.ass FILE.mp4 --sub-scale=1.8 --sub-margin-y=0 --sub-ass-force-margins

run mpv via ssh on remote machine (that'what I usually use because of audio / video machine separation): ssh MACHINE "DISPLAY=:0 nohup mpv --fs-screen=1 --fs 'file.mp4'" Note the DISPLAY=:0 to identify the X display to use and the nohup to get independent from the ssh connection (Video might stop on network failure without)

well and that might be useful as well: --no-osd-bar

Using an awesome window manager (I'm running LMDE3 with Cinnamon (muffin) on my video machine. I enabled fading window effects, so starting and stopping videos, slideshows, presentations has got nice fading. Screen is black, but you can also add a wallpaper fitting to your organization. I sometimes use the clock desklet with custumizable text / format to display something like "Event XY on 13th May 2019, 22:45" when there's nothing else to show.

Himura2la commented 3 years ago

Video cues wound be an awesome feature. There's absolutely no free alternative to QLab, which forced me to write my own app for live shows. And I don't like it :)

sonicyouch commented 2 years ago

I totally agree, video cues would make that awesome software perfect. Hope that feature will come soon :)

fnetX commented 2 years ago

A quick workaround might be to still depend on mpv, but allow some launcher wrappers for convenience. MPV is an awesome project and will work reliably and play kinda all your video files, you can even use it to create image slide shows etc (so whenever we need to launch a pic from within LiSP, we'll use mpv, too).

bgoldstone commented 6 months ago

I would be interested in helping this, but I am not familiar with the code base. @FrancescoCeruti

FrancescoCeruti commented 6 months ago

I would be interested in helping this, but I am not familiar with the code base. @FrancescoCeruti

The way I've envisioned this task will require a non-trivial rework of the media backend, but I believe it can be approached in two main iterations:

  1. Implement video elements (wrapping GStreamer) to allow the creation of video-only cue
  2. Rework the elements composition logic and UI to support cues that can handle both audio and video

The area of interest is the gst_backend plugin, the entry point it's here: gst_backend.py

In there you should be able to register a custom "factory" to create a video cue, which should simply be a MediaCue but initialized with elements (pipeline) that handle the video stream instead of the audio.

The "pipeline" definition is a list of the elements class names.

Elements are located in the lisp.plugins.gst_backend.elements module, they are imported dynamically.

Most elements are simple wrappers, you can start with that, but you need to know what gstreamer-elements you need to use. To start experiment you can simply use videotestsrc (generates a test video stream) and autovideosink (display the video in a window), you can search the gstreamer documentation for details.

Just a quickstart, if you have any question we can chat via matrix @francesco.ceruti:matrix.org or open a discussion here on GitHub.

DMJC commented 3 months ago

I have two workarounds for this depending on what's needed. One is to control OBS and use OBS to playback video files using the media player plugin. I use Linux Show Player to switch scenes in OBS to the video file using the command queue and the OBS CLI Interface. The other way (more complex) is to have Linux Show Player trigger a video player on a screen and have OBS capture the window as a scene and have Linux Show Player trigger a transition to the screen capture screen in OBS.

fnetX commented 3 months ago

@DMJC this sounds rather complex, tbh. Launching mpv, even via remote SSH connection was always the way to go.

You can also make it open a socket and send IPC commands to it. There are some examples in the docs: https://linux-show-player-users.readthedocs.io/en/latest/cues/misc_cues.html#mpv-player

I've successfully run many shows with launching mpv directly or via SSH, and recently started to use the IPC to do things like automated fade down, or enabling / disabling looping of intro trailers.

DMJC commented 3 months ago

We were cross mixing multiple cameras shots/slide shows etc in our feed using one computer with a Decklink 8K card + 4 SDI cameras to handle all vision (Anime/Video Games Convention was the use case). It worked extremely well once we added Linux-Show-Player to control it all... We only ever touch OBS for switching between cameras on live crosses, everything else is in LSP. Cosplay controls became z-x to control the slideshow and spacebar to trigger music/slideshow/camera transition cues.

griuzly commented 3 months ago

You can also make it open a socket and send IPC commands to it. There are some examples in the docs: https://linux-show-player-users.readthedocs.io/en/latest/cues/misc_cues.html#mpv-player

I've successfully run many shows with launching mpv directly or via SSH, and recently started to use the IPC to do things like automated fade down, or enabling / disabling looping of intro trailers.

I use LSP for my theatrical shows with Command Cues for video and mpv is the first choice. I read docs about IPC commands and was successfull in sending simple commands to mpv by this way but I have no idea how to automate a video fade down... can you post an example?

fnetX commented 2 months ago

@griuzly this is a little hacky. I created a shell script which I run as a "command cue" which adjusts brightness in a loop. Will share it later, it's unfortunately not on my machine at home.

griuzly commented 1 month ago

@griuzly this is a little hacky. I created a shell script which I run as a "command cue" which adjusts brightness in a loop. Will share it later, it's unfortunately not on my machine at home.

I wrote some shell scripts too using xrandr that acts on the brightness to get fade in and out. But it can't obviously crossfade the video in this way. To explain better: I can get video fade-in with this command: mpv -fs-screen=1 -fs '--vf=fade:t=in:st=0:d=20' --input-ipc-server=./testsocket --keep-open=always --osc=no videofile But I can't command a fade-out with: echo no-osd vf set fade=t=out:st=0:d=20 | socat - ./testsocket because of the st parameter that represents the frame number and I can't know the exact frame number when I will press GO during a show. Furthermore a second instance of mpv always overlaps the others. Has anyone ever successfully managed to create a video crossfade?

FrancescoCeruti commented 1 month ago

I've never used it, but you could give a try at this: https://github.com/brunoherbelin/vimix? It supports OSC (https://github.com/brunoherbelin/vimix/wiki/Open-Sound-Control-API) so you should be able to control it from LiSP

fnetX commented 1 month ago

@griuzly I created a script (still didn't manage to grab a copy from the machine, sorry) that sends brightness commands in a loop to fade out. It is triggered by LiSP and then uses the mpv socket to reduce brightness.

Regarding crossfade .. what I often do to workaround is to rely on my window manager and effects. I'd probably let mpv open on the secondary (non-presenting) screen and use a hotkey to move it over + assign a fade-in effect for window moving. Hacky but could do the trick.

griuzly commented 1 month ago

I've never used it, but you could give a try at this: https://github.com/brunoherbelin/vimix? It supports OSC (https://github.com/brunoherbelin/vimix/wiki/Open-Sound-Control-API) so you should be able to control it from LiSP

Interesting project. I can crossfade video with OSC commands like this: /vimix/video01/transparency ff 1.0 1000 && /vimix/video02/alpha ff 1.0 1000

The problem is that vimix has no audio support.

It seems more promising the gstreamer approach usig ges-launch. With this command is possible to play video setting their opacity/transparency: ges-launch-1.0 +clip video01.mpg layer=1 set-alpha 0.5 +clip video02.mpg layer=0 set-alpha 0.5

but I didn't find something like ff parameter in vimix osc commands that assigns variable opacity/transparency from a value to another value in a certain time.