mpv-player / mpv-player/mpv

Add utility function mp.utils.process_path

Open
#13,343 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

meta:feature-request
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

Expected behavior of the wanted feature

For user scripts, sometimes it would be helpful knowing the process path, the script can know then if mpv or a frontend is used and what is the name and path of the frontend.

A use case for this is the thumbfast script, there are two frontends which have encoding support for thumbnail generation, that is ImPlay and mpv.net. The thumbfast script has an option to define the process path, unfortunately many users have difficulties to find and configure this option. If there would be a process_path utility function, the script could configure it automatically. This would also remove the necessity of mpv or the frontend being in the path env var, which is helpful for beginner users.

https://github.com/mpvnet-player/mpv.net/blob/main/docs/manual.md#user-data

https://github.com/po5/thumbfast?tab=readme-ov-file#mpv-frontends

https://github.com/po5/thumbfast/pull/113

Another method not used so far is using the LuaJIT FFI to get the process path.

@po5
@tsl0922

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the mp.utils entry point and review the linked mpv.net documentation and thumbfast usage for the expected process-path value. Done means user scripts can obtain the mpv or frontend executable path through mp.utils.process_path without requiring the executable to be present in PATH.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, lua
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.