Skip to content

A little application that makes it possible to display mpv's subs anywhere you want. With translation features.

License

Notifications You must be signed in to change notification settings

sdaqo/mpv-subs-popout

Repository files navigation

Mpv Subs Popout

A little application that makes it possible to display mpv's subs anywhere you want, it also includes translation (potentially for language learning).

Why? You can now watch shows in foreign languages on your second monitor and do other stuff on your main monitor while still being able to read the subs. (Thats why I built this anway)

mpv-subs.mp4

Installation

Mpv Configuration

This app uses mpv's ipc to get the current subs so you have to activate it:

For Linux Add input-ipc-server=/tmp/mpvsock to your mpv config.

For Windows Add input-ipc-server=\\.\pipe\mpvsock to your mpv config.


NixOS

mpv-subs-popout is available in the official nixpkgs (it is currently on the unstable branch)

Try it out with nix run nixpkgs#mpv-subs-popout or add it to you config:

environment.systemPackages = [ pkgs.mpv-subs-popout ];

# With home manager
home.packages = [ pkgs.mpv-subs-popout ];

If you are using homemanager you can specify the input-ipc-server for mpv directly in your config via

programs.mpv.input-ipc-server = "/tmp/mpvsock";

Arch

With Aur helper:

yay -S mpv-subs-popout 

If you do not have any aur helpers:

mkdir mpv-subs-popout && cd mpv-subs-popout

# Get the PKGBUILD
wget 'https://raw.githubusercontent.com/sdaqo/mpv-subs-popout/main/PKGBUILD'

makepkg -si
cd .. && rm -rf mpv-subs-popout

Debian (or a derivative)

Download the latest .deb release from the releases page. And then:

# The ./ is important else it does not install from the file.
apt install ./name_of_deb.deb

Other Distros

Just download the binary release from the releases page or maybe your distro has any way to install from .deb files (search it up).

Windows

Download the latest release from the releases page.

Unzip the .zip and start mpv-subs-popout.exe to start the application.

Building

Linux

To Build a plain and simple binary you will need the libs for gtk3, glib, pango and cairo (probably preinstalled if you are on a system with graphical interface). You will also need Cargo (I recommend you use rustup to install it).

git clone "https://github.com/sdaqo/mpv-subs-popout" && cd mpv-subs-popout

cargo build --release

# To run it
./target/release/mpv-subs-popout

To build the .deb do this:

cargo deb
cd target/debian

Windows

Install rust and Cargo with rustup.

All the following commands are executed in the Windows Powershell

  1. Install Chocolately. This makes it easier to install the building requirements.
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
  1. Install build requirements
choco install git
choco install mysys2
choco install visualstudio2022buildtools
choco install visualstudio2022-workload-vctools
choco install python

# Restart Shell here

From here you might also want to follow the ci build steps, they lead you to the same *.zip as in the release builds.

  1. Install gvsbuild
python -m pip install --user pipx
python -m pipx ensurepath

# Restart Shell here

pipx install gvsbuild
  1. Build Gtk3 and add it to your Environment Variables
# This will take a while
gvsbuild build gtk3


$env:Path = "C:\gtk-build\gtk\x64\release\bin;" + $env:Path
$env:LIB = "C:\gtk-build\gtk\x64\release\lib;" + $env:LIB
$env:INCLUDE = "C:\gtk-build\gtk\x64\release\include;C:\gtk-build\gtk\x64\release\include\cairo;C:\gtk-build\gtk\x64\release\include\glib-2.0;C:\gtk-build\gtk\x64\release\include\gobject-introspection-1.0;C:\gtk-build\gtk\x64\release\lib\glib-2.0\include;" + $env:INCLUDE
  1. Build Rust application
# Clone Repo
git clone "https://github.com/sdaqo/mpv-subs-popout"
cd 'mpv-subs-popout'

# Set toolchain
rustup default stable-msvc

# Build
cargo build --release

# To run it
./target/release/mpv-subs-popout.exe

Features

  • Full custom translator widget (Google, DeeplX)
  • Auto translation in seperate line
  • Always works: Open mpv after the Popout or before, it detects mpv and attaches itself
  • Custom Font and Font size
  • Always on Top & Docked mode
  • Custom bg color
  • Custom text color
  • Linux & Windows Support

Note 1: Some features like docked or always on top do not work under wayland!

Note 2: When setting the api key for the /v2/translate endpoint for DeeplX do it like this (with space) [yourAccessToken] [yourAuthKey]

Planned

  • Dictionary for looking up words
  • Any other suggested features (Make an Issue)

About

A little application that makes it possible to display mpv's subs anywhere you want. With translation features.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages