-
Notifications
You must be signed in to change notification settings - Fork 3k
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
mpv not opening file in same process #3811
Comments
It's a feature. On Linux there's a script ( |
I need this feature,It could open many file at the same time? |
As a possible workaround, there's rossy's |
Thanks |
I found 2 things, but I'm not sure how to use them. Notify me if you know.
|
Another script
|
With all due respect, using PowerShell to do just that is stupid damn, it's like wanting to kill flies to cannon shots. Not to mention that PowerShell is just another "permanent security hole" in the operating system. This batch do exact the same:
A more hostile variant:
Less hostile...:
cya |
Just to avoid any possible confusion: This is just the old wait trick.. |
I posted this on another issue already, but this one appears to be specifically about Windows. Anyway, I gave implementing single instance mode for Windows a shot: https://github.com/SilverEzhik/umpvw It handles things macOS-style - opening a file will replace what you have running`. It also handles opening multiple files as a playlist via IPC. |
I don't understand why dev team does not implement this mechanism by creating a simple named kernel object (e.g. semaphore) at startup and check if the particular object exists at startup and if so redirect playback request to existing instance and terminate the extra instance. This is usually how it is handled instead of unnecessary 3rd party scripts. Can somebody explain? |
i don't know who that "dev team" team is. though that person probably doesn't want to implement it since they doesn't see a need for it. |
Here's a need for it: You are already playing a file in the background, meanwhile you are also exploring other files, finally you decide to choose a new file to play and click on it. Now you have two instances playing different files simultaneously causing you to manually have to close the other instance, which could have been solved with the method i have talked about. This is not a obscure niche feature, it is already implemented in various software (e.g. MPC-HC, VLC etc.). I am aware of the open source nature of the project and I know that there is not a "dev team" per se. But usually in every project there is a team of people actively working on the project, that's what I meant. |
that's just the use case and no one questioned that one. i meant a personal need, so that person is not implementing it. if the interests of that specific dev doesn't align with the interest of specific users it can't be helped. there is even less of an incentive since it is already possible with scripts etc and if one doesn't aim for a specific implementations this issue is basically 'solved'. you either have to wait till someone implements your wanted feature or you have to do it yourself. |
sry |
I'm new to using mpv and I've been trying to figure out how to deal with this on Windows. I've already installed using shinchiro's build from mpv's site. Should I be using @SilverEzhik 's method to fix it. If so, how would I go about that if I already have the latest build installed? If I should be creating a batch file, how should I be handling it(how to make it run when I want to, and how to make it stop when it shouldn't be running)? @Jj0YzL5nvJ |
Most likely yes, just follow the instructions found at his other repo here. |
Alternatively, I also made the following batch file a long time ago to test single-instance mode via the built-in Windows cmd.exe facility, so I'll just paste it below in case someone finds it useful: @echo off
setlocal enableextensions enabledelayedexpansion
:: strip double quotes from the "%1" argument if present, just in case (it'll be added later)
set "input=%~1"
:: convert backslashes into forward slashes, so 'echo loadfile' doesn't need escaped backslashes
set "output=%input:\=/%"
set cli_args=%*
set mpv_args=!cli_args:%1=!
tasklist /FI "IMAGENAME eq mpv.exe" 2>nul | findstr /i "mpv.exe" >nul
IF %errorlevel% EQU 0 ( goto :mpvIsRunning ) ELSE (
start "" mpv.exe --input-ipc-server=mpv-socket %mpv_args% "%output%"
goto :End
)
:mpvIsRunning
echo loadfile "%output%">\\.\pipe\mpv-socket
:End
endlocal |
@shinchiro, how about an alternative installer using @garoto's script? |
Please don't. This is just a silly prototype, if even that, and while it seems to work as far I was able to test it, I can only imagine it can|will fail in many specific circunstances. Also, associating this |
|
For anybody still dealing with this on Windows 10, I packaged mpv for the Microsoft Store with a single instance mode wrapper and file association defaults: https://www.microsoft.com/store/productId/9P3JFR0CLLL6 The source is available here: https://github.com/SilverEzhik/mpv-msix |
Hi, I implemented a more versatile version of above mentioned zenden2k/context-menu-launcher. https://github.com/ge9/ExecuteCommand-Pipe It can pass input files to any program through standard input (in UTF-8). No change of order during interprocess communication, and no limitation on path length or number of files. |
anyone knows how to enable this UMPV feature in linux? |
https://raw.githubusercontent.com/mpv-player/mpv/master/TOOLS/umpv On Arch you can get it from /usr/share/mpv/scripts/umpv. |
I am on the latest windows 64 bit build available here: https://mpv.srsfckn.biz/ (10/20 as of today). I already have mpv as the default filetype. When I have mpv already open and I click on a video to play in my file explorer, instead of playing in the already open mpv process, it creates a new one so now there's 2 mpvs playing. Is this as intended and if so, how do I make it stick to using only 1 process?
The text was updated successfully, but these errors were encountered: