General fluff => Announcements => Topic started by: time-killer-games on August 12, 2020, 08:21:44 PM

Title: Video Player Extension for ENIGMA Early Access
Post by: time-killer-games on August 12, 2020, 08:21:44 PM
The pull request will be more up-to-date than the information and download available in this thread.

To get the latest scoop on what progress has been made, please check out the actual pull request:



Finally, official video playback functionality is being added to ENIGMA.

For early access to download and installation instructions, read on...

This extension bypasses the GPL of mpv media player it uses because you aren't linking with it and you are not using its source code compiled into your exe, you are just running it from the command line, and embedding it in your game window using the --wid=whatever flag; this means you don't have to share the source code of your app. If you provide the mpv media player executable bundled with your game distribution you will also be responsible for providing the source code to mpv media player itself with your game as that part of the GPL license still applies. Not the source of your game; mpv's source. Since Linux and FreeBSD allow you to install mpv media player via your package manager, on those platforms this doesn't apply.


    - create videos in new windows transient to given windows.
    - allow embedding videos in windows with given rectangles.
    - override Windows DirectShow with mpv if "mpv.exe" exists.
    - note: overriding to use mpv allows for more video formats.
    - move "insecure_bullshit.cpp" files to engine for easy reuse.
    - remove unused functionality for async std output reading.

Supports / Details:

    - Windows with all the graphics systems supported by Win32.
    - Windows needs MPEG-2 video + MP2 audio + *.MPG format.
    - Use XMedia Recode to convert videos to the required format.
    - Windows uses DirectShow so no need for mpv dependency.
    - X11 on Linux and FreeBSD under most Window Managers.
    - X11 on Linux and FreeBSD support everything ffmpeg does.
    - Supports Environment Variables in video path %VAR% $VAR.
    - embed the video in an existing window id or embed in-game.
    - use window_identifier() EDL for the window id of your game.
    - you can get the window id a given video index is embedded.

Doesn't Support:

    - Won't work on macOS unless we use libmpv directly instead of the command line program which has licensing issues.
    - macOS can't embed windows belonging to other processes that are not the current one. So a libmpv version is needed.
    - mpv media player has no way to use --wid on a Wayland-based window so Linux/BSD+SDL will not work until later on.
    - Doesn't seem to work on SDL for X11 either, which is odd, because it is getting the right window identifier so that's odd.
    - Some less common X11 Window Managers causes the embedded mpv media player window to flicker, (like OpenBox).
    - SDL doesn't work on Windows either (wtf). The game just opens and then closes as soon as a video_play's been called.

Download Demo GM81 Project + Windows EXE:

Download "Video Player" Extension for ENIGMA:

Microsoft Windows Installation:
Code: [Select]
Download 7zip archiver; use it to extract the folder to this location:

Ubuntu / Debian Linux Installation:
Code: [Select]
sudo apt-get install ffmpeg mpv libprocps-dev
mv ~/Downloads/VideoPlayer.tar.gz ~/enigma-dev/ENIGMAsystem/SHELL/Universal_System/Extensions/VideoPlayer.tar.gz
cd ~/enigma-dev/ENIGMAsystem/SHELL/Universal_System/Extensions
tar -xvf VideoPlayer.tar.gz
rm VideoPlayer.tar.gz

Arch / Manjaro Linux Installation:
Code: [Select]
sudo pacman -Sy ffmpeg mpv
mv ~/Downloads/VideoPlayer.tar.gz ~/enigma-dev/ENIGMAsystem/SHELL/Universal_System/Extensions/VideoPlayer.tar.gz
cd ~/enigma-dev/ENIGMAsystem/SHELL/Universal_System/Extensions
tar -xvf VideoPlayer.tar.gz
rm VideoPlayer.tar.gz

FreeBSD Installation:
Code: [Select]
sudo pkg install ffmpeg mpv
mv ~/Downloads/VideoPlayer.tar.gz ~/enigma-dev/ENIGMAsystem/SHELL/Universal_System/Extensions/VideoPlayer.tar.gz
cd ~/enigma-dev/ENIGMAsystem/SHELL/Universal_System/Extensions
tar -xvf VideoPlayer.tar.gz
rm VideoPlayer.tar.gz