Skip to content
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

frontends: better support for mpv.net #113

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ Hover on the timeline for nice thumbnails.
- [mfpbar](https://codeberg.org/NRK/mpv-toolbox/src/branch/master/mfpbar)

## mpv frontends
If you are using a GUI frontend such as [mpv.net](https://github.com/mpvnet-player/mpv.net), you will need [standalone mpv](https://mpv.io/installation/) accessible within [Path](https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574(v=office.14)#to-add-a-path-to-the-path-environment-variable).
The easiest way is to copy standalone mpv files inside of your mpv.net installation folder.
[mpv.net](https://github.com/mpvnet-player/mpv.net) since version 7.0.0.6 is directly supported, a special configuration isn't required, for earlier versions or other frontends, you will need [standalone mpv](https://mpv.io/installation/) accessible within [Path](https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574(v=office.14)#to-add-a-path-to-the-path-environment-variable).
The easiest way is to copy standalone mpv files inside of your frontend installation folder.
It will be used in the background to generate thumbnails.

The only exception is [ImPlay](https://tsl0922.github.io/ImPlay/), which can do thumbnailing on its own.
[ImPlay](https://tsl0922.github.io/ImPlay/) can do thumbnailing on its own.
Set `mpv_path=ImPlay` in `script-opts/thumbfast.conf`.

## MacOS
Expand Down
2 changes: 1 addition & 1 deletion thumbfast.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ hwdec=no
direct_io=no

# Custom path to the mpv executable
mpv_path=mpv
mpv_path=auto
13 changes: 12 additions & 1 deletion thumbfast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ local options = {
direct_io = false,

-- Custom path to the mpv executable
mpv_path = "mpv"
mpv_path = "auto"
}

mp.utils = require "mp.utils"
Expand Down Expand Up @@ -275,6 +275,17 @@ options.scale_factor = math.floor(options.scale_factor)

local mpv_path = options.mpv_path

if mpv_path == "auto" then
local frontend_name = mp.get_property_native("user-data/frontend/name")
if frontend_name == "mpv.net" then
mpv_path = mp.get_property_native("user-data/frontend/process-path")
end
end

if mpv_path == "auto" then
mpv_path = "mpv"
end

if mpv_path == "mpv" and os_name == "darwin" and unique then
-- TODO: look into ~~osxbundle/
mpv_path = string.gsub(subprocess({"ps", "-o", "comm=", "-p", tostring(unique)}).stdout, "[\n\r]", "")
Expand Down