Questions tagged [mpv]

The [mpv] tag is for questions about programmatically interacting with the mpv media player or its C library.

mpv is a free, open source, and cross-platform media player. It is a fork of mplayer2 and MPlayer. It shares some features with the former projects while introducing many more.

mpv can be controlled via a command line interface and/or via a JSON-based IPC protocol. It also has a C API which makes it usable as a library.

92 questions
2
votes
0 answers

Is it possible to have a custom chapters file for each link/file in a playlist file in MPV?

I would like to load a playlist file that contains YouTube URLs in MPV. Like this: playlists.txt https://www.youtube.com/watch?v=86cQJ0MMses https://www.youtube.com/watch?v=s22eJ1eVLTU And one or multiple chapters…
Klokat
  • 53
  • 2
2
votes
0 answers

Is there a denoiser with GLSL for mpv?

It would be great to just put a GLSL shader in configs that will denoise a video. I tried putting the line "denoise=1" in mpv.conf but it didn't work: on Windows 10 "Error parsing option denoise (option not found)". With Linux I don't remember if…
2
votes
1 answer

MPV: Get window position and size? Or window-moved/resized event?

Is there a way to get the current position and size of the MPV media player's window (or an event that fires when they are changed)? I'm trying to make a script that automatically saves the last position of the window, and then loads it when the…
The Oddler
  • 6,314
  • 7
  • 51
  • 94
2
votes
1 answer

How to play a sound file while running a program in Bash

I'm creating an alarm clock script as I haven't found a good Linux alarm yet and I decided it would be a good idea to learn Bash scripting(again). I'm looking into making a program that plays an alarm sound(beep beep full volume) and I want the…
Jareg
  • 155
  • 2
  • 10
1
vote
2 answers

How do I expand on this one line Perl script to run a command until specific KEYWORD in output, then also play a sound?

I have a problem with my NordVPN account where I have to sometimes run the client upwards of 10 times, with their terrible CLI tool, until it finally successfully chooses a server that accepts my login. I came across an old post here which I adapted…
1
vote
1 answer

Command not found when using std::process::command in rust?

So, i am getting this error when i run a command in linux terminal using std::process::Command. The part of the code is: use std::process::Command; fn main() { let mut playmusic = "mpv https://www.youtube.com/watch?v=kJQP7kiw5Fk"; let…
1
vote
1 answer

Use fdfind and fzf to open files in mpv

kdialog-open-files.lua and zenity-open-files.lua are two projects that use KDE KDialog and Gnome's zenity respectively to open files in mpv. I wish to do the same using fdfind and fzf. As illustrated in this stackoverflow answer the following works…
Inspired_Blue
  • 2,308
  • 3
  • 15
  • 21
1
vote
1 answer

How to render MPV to GTK4 window on X11 with python?

How can mpv render to GTK4 window or widget? In GTK3 it was quite easy to get XID (and put it as argument to MPV) but in GTK4 It seem have to be done with GtkX11 and X11Surface https://docs.gtk.org/gdk4-x11/method.X11Surface.get_xid.html But I have…
d3im
  • 323
  • 2
  • 4
  • 18
1
vote
1 answer

What's the correct way to escape characters in m3u playlist?

I have a file name that contains a "#" character and I am having issues creating a playlist that both VLC and MPV will accept (those are the two players I have tested.) It seems if I use the following, it will work in MPV but not…
Chris_F
  • 4,991
  • 5
  • 33
  • 63
1
vote
1 answer

What does "no error" mean when writing to a file in Lua?

I am writing a script to add one line in a .txt per video while using MPV. However, I am getting a weird error on line 68 with the for loop. It merely tells me: no error. If I add an error parameter to file:write(message, error), it gives me another…
Kayi
  • 11
  • 3
1
vote
1 answer

MVP player embedded in PySide app not receiving mouse clicks on Windows

I'm building a PySide/Qt based app that with video playback. I found mpv player and the helpful python-mpv library to get it into my Python based app. Everything works great. The issue I'm having is trying to use the player on a Windows machine (no…
motman
  • 44
  • 4
1
vote
0 answers

Possible to allow key bindings with MPV C API when no video (GUI) is being shown?

I am creating a background music player and I wanted to use the MPV C Plugin to do so, but my problem arrives when I disable displaying the video (with check_error(mpv_set_option_string(ctx, "vid", "no"));, this does the job of disabling the video,…
Netsu
  • 1,399
  • 1
  • 7
  • 18
1
vote
1 answer

How do I tell meson setup about the location of a dependency?

I'm trying to build celluloid, which uses meson. I ran meson, but it failed to find an appropriate version of mpv: Determining dependency 'mpv' with pkg-config executable '/usr/bin/pkg-config' Called `/usr/bin/pkg-config --modversion mpv` ->…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
1 answer

Lua script for mpv - different duration for each file in a directory

I searched and tried possible solutions for a lua script that autoloop some images from one directory. The result should be these images to be launched by mpv(media player) with a different duration. I know there is an autoload script that takes…
1
vote
0 answers

XLib: change opacity of child window (MPV)

I have this code in C: #include #include #include #include #include #include // Handle MPV errors void checkMPV(int status) { if (status < 0) { printf("MPV error: %s\n",…
Malyutin Egor
  • 127
  • 1
  • 10